@nestjs/testing 11.0.0 → 11.0.2
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 +1 -1
- package/test.d.ts +2 -2
- package/test.js +2 -2
- package/testing-module.builder.d.ts +5 -1
- package/testing-module.builder.js +2 -2
package/package.json
CHANGED
package/test.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleMetadata } from '@nestjs/common/interfaces/modules/module-metadata.interface';
|
|
2
|
-
import { TestingModuleBuilder } from './testing-module.builder';
|
|
2
|
+
import { TestingModuleBuilder, TestingModuleOptions } from './testing-module.builder';
|
|
3
3
|
export declare class Test {
|
|
4
4
|
private static readonly metadataScanner;
|
|
5
|
-
static createTestingModule(metadata: ModuleMetadata): TestingModuleBuilder;
|
|
5
|
+
static createTestingModule(metadata: ModuleMetadata, options?: TestingModuleOptions): TestingModuleBuilder;
|
|
6
6
|
}
|
package/test.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.Test = void 0;
|
|
|
4
4
|
const metadata_scanner_1 = require("@nestjs/core/metadata-scanner");
|
|
5
5
|
const testing_module_builder_1 = require("./testing-module.builder");
|
|
6
6
|
class Test {
|
|
7
|
-
static createTestingModule(metadata) {
|
|
8
|
-
return new testing_module_builder_1.TestingModuleBuilder(this.metadataScanner, metadata);
|
|
7
|
+
static createTestingModule(metadata, options) {
|
|
8
|
+
return new testing_module_builder_1.TestingModuleBuilder(this.metadataScanner, metadata, options);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.Test = Test;
|
|
@@ -5,6 +5,10 @@ import { MetadataScanner } from '@nestjs/core/metadata-scanner';
|
|
|
5
5
|
import { MockFactory, OverrideBy } from './interfaces';
|
|
6
6
|
import { OverrideModule } from './interfaces/override-module.interface';
|
|
7
7
|
import { TestingModule } from './testing-module';
|
|
8
|
+
/**
|
|
9
|
+
* @publicApi
|
|
10
|
+
*/
|
|
11
|
+
export type TestingModuleOptions = Pick<NestApplicationContextOptions, 'moduleIdGeneratorAlgorithm'>;
|
|
8
12
|
/**
|
|
9
13
|
* @publicApi
|
|
10
14
|
*/
|
|
@@ -17,7 +21,7 @@ export declare class TestingModuleBuilder {
|
|
|
17
21
|
private readonly module;
|
|
18
22
|
private testingLogger;
|
|
19
23
|
private mocker?;
|
|
20
|
-
constructor(metadataScanner: MetadataScanner, metadata: ModuleMetadata);
|
|
24
|
+
constructor(metadataScanner: MetadataScanner, metadata: ModuleMetadata, options?: TestingModuleOptions);
|
|
21
25
|
setLogger(testingLogger: LoggerService): this;
|
|
22
26
|
overridePipe<T = any>(typeOrToken: T): OverrideBy;
|
|
23
27
|
useMocker(mocker: MockFactory): TestingModuleBuilder;
|
|
@@ -16,12 +16,12 @@ const testing_module_1 = require("./testing-module");
|
|
|
16
16
|
* @publicApi
|
|
17
17
|
*/
|
|
18
18
|
class TestingModuleBuilder {
|
|
19
|
-
constructor(metadataScanner, metadata) {
|
|
19
|
+
constructor(metadataScanner, metadata, options) {
|
|
20
20
|
this.metadataScanner = metadataScanner;
|
|
21
21
|
this.applicationConfig = new application_config_1.ApplicationConfig();
|
|
22
|
-
this.container = new container_1.NestContainer(this.applicationConfig);
|
|
23
22
|
this.overloadsMap = new Map();
|
|
24
23
|
this.moduleOverloadsMap = new Map();
|
|
24
|
+
this.container = new container_1.NestContainer(this.applicationConfig, options);
|
|
25
25
|
this.module = this.createModule(metadata);
|
|
26
26
|
}
|
|
27
27
|
setLogger(testingLogger) {
|