@nestjs/testing 12.0.0-alpha.3 → 12.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/testing",
3
- "version": "12.0.0-alpha.3",
3
+ "version": "12.0.0-alpha.4",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@testing)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -41,5 +41,5 @@
41
41
  "optional": true
42
42
  }
43
43
  },
44
- "gitHead": "1c9d5482a65a446ede8dd1195bfa1cbbc16e0857"
44
+ "gitHead": "415e4d33707e74998d8456be7bd305cedb6508e3"
45
45
  }
package/testing-module.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Logger, } from '@nestjs/common';
2
2
  import { NestApplication, NestApplicationContext, } from '@nestjs/core';
3
- import { loadPackage, loadPackageCached, isUndefined, } from '@nestjs/common/internal';
3
+ import { tryLoadPackage, loadPackageCached, isUndefined, } from '@nestjs/common/internal';
4
4
  /**
5
5
  * @publicApi
6
6
  */
@@ -19,9 +19,8 @@ export class TestingModule extends NestApplicationContext {
19
19
  * Called from TestingModuleBuilder.compile().
20
20
  */
21
21
  async preloadLazyPackages() {
22
- // Best-effort: silently swallow if packages are not installed
23
- await loadPackage('@nestjs/platform-express', 'TestingModule', () => import('@nestjs/platform-express')).catch(() => { });
24
- await loadPackage('@nestjs/microservices', 'TestingModule', () => import('@nestjs/microservices')).catch(() => { });
22
+ await tryLoadPackage('@nestjs/platform-express', () => import('@nestjs/platform-express'));
23
+ await tryLoadPackage('@nestjs/microservices', () => import('@nestjs/microservices'));
25
24
  }
26
25
  isHttpServer(serverOrOptions) {
27
26
  return !!(serverOrOptions && serverOrOptions.patch);