@nestjs/testing
Advanced tools
Comparing version 11.0.1 to 11.0.2
{ | ||
"name": "@nestjs/testing", | ||
"version": "11.0.1", | ||
"version": "11.0.2", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@testing)", | ||
@@ -5,0 +5,0 @@ "author": "Kamil Mysliwiec", |
import { ModuleMetadata } from '@nestjs/common/interfaces/modules/module-metadata.interface'; | ||
import { TestingModuleBuilder } from './testing-module.builder'; | ||
import { TestingModuleBuilder, TestingModuleOptions } from './testing-module.builder'; | ||
export declare class Test { | ||
private static readonly metadataScanner; | ||
static createTestingModule(metadata: ModuleMetadata): TestingModuleBuilder; | ||
static createTestingModule(metadata: ModuleMetadata, options?: TestingModuleOptions): TestingModuleBuilder; | ||
} |
@@ -7,4 +7,4 @@ "use strict"; | ||
class Test { | ||
static createTestingModule(metadata) { | ||
return new testing_module_builder_1.TestingModuleBuilder(this.metadataScanner, metadata); | ||
static createTestingModule(metadata, options) { | ||
return new testing_module_builder_1.TestingModuleBuilder(this.metadataScanner, metadata, options); | ||
} | ||
@@ -11,0 +11,0 @@ } |
@@ -11,2 +11,6 @@ import { LoggerService, ModuleMetadata } from '@nestjs/common'; | ||
*/ | ||
export type TestingModuleOptions = Pick<NestApplicationContextOptions, 'moduleIdGeneratorAlgorithm'>; | ||
/** | ||
* @publicApi | ||
*/ | ||
export declare class TestingModuleBuilder { | ||
@@ -21,3 +25,3 @@ private readonly metadataScanner; | ||
private mocker?; | ||
constructor(metadataScanner: MetadataScanner, metadata: ModuleMetadata); | ||
constructor(metadataScanner: MetadataScanner, metadata: ModuleMetadata, options?: TestingModuleOptions); | ||
setLogger(testingLogger: LoggerService): this; | ||
@@ -24,0 +28,0 @@ overridePipe<T = any>(typeOrToken: T): OverrideBy; |
@@ -19,8 +19,8 @@ "use strict"; | ||
class TestingModuleBuilder { | ||
constructor(metadataScanner, metadata) { | ||
constructor(metadataScanner, metadata, options) { | ||
this.metadataScanner = metadataScanner; | ||
this.applicationConfig = new application_config_1.ApplicationConfig(); | ||
this.container = new container_1.NestContainer(this.applicationConfig); | ||
this.overloadsMap = new Map(); | ||
this.moduleOverloadsMap = new Map(); | ||
this.container = new container_1.NestContainer(this.applicationConfig, options); | ||
this.module = this.createModule(metadata); | ||
@@ -27,0 +27,0 @@ } |
35705
481