• Version 9.2.1
  • Published
  • 35.4 kB
  • 1 dependency
  • MIT license


npm i @nestjs/testing
yarn add @nestjs/testing
pnpm add @nestjs/testing


Nest - modern, fast, powerful node.js web framework (@testing)



class Test

class Test {}

    method createTestingModule

    static createTestingModule: (metadata: ModuleMetadata) => TestingModuleBuilder;

      class TestingModule

      class TestingModule extends NestApplicationContext {}


        container: NestContainer,
        scope: Type<any>[],
        contextModule: Module,
        applicationConfig: ApplicationConfig

          method createNestApplication

          createNestApplication: {
          <T extends INestApplication = INestApplication>(
          httpAdapter: HttpServer | AbstractHttpAdapter,
          options?: NestApplicationOptions
          ): T;
          <T extends INestApplication = INestApplication>(
          options?: NestApplicationOptions
          ): T;

            method createNestMicroservice

            createNestMicroservice: <T extends object>(
            options: NestMicroserviceOptions & T
            ) => INestMicroservice;

              class TestingModuleBuilder

              class TestingModuleBuilder {}


                constructor(metadataScanner: MetadataScanner, metadata: ModuleMetadata);

                  method compile

                  compile: () => Promise<TestingModule>;

                    method overrideFilter

                    overrideFilter: <T = any>(typeOrToken: T) => OverrideBy;

                      method overrideGuard

                      overrideGuard: <T = any>(typeOrToken: T) => OverrideBy;

                        method overrideInterceptor

                        overrideInterceptor: <T = any>(typeOrToken: T) => OverrideBy;

                          method overridePipe

                          overridePipe: <T = any>(typeOrToken: T) => OverrideBy;

                            method overrideProvider

                            overrideProvider: <T = any>(typeOrToken: T) => OverrideBy;

                              method setLogger

                              setLogger: (testingLogger: LoggerService) => this;

                                method useMocker

                                useMocker: (mocker: MockFactory) => TestingModuleBuilder;


                                  interface OverrideBy

                                  interface OverrideBy {}

                                    property useClass

                                    useClass: (metatype: any) => TestingModuleBuilder;

                                      property useFactory

                                      useFactory: (options: OverrideByFactoryOptions) => TestingModuleBuilder;

                                        property useValue

                                        useValue: (value: any) => TestingModuleBuilder;

                                          interface OverrideByFactoryOptions

                                          interface OverrideByFactoryOptions {}

                                            property factory

                                            factory: (...args: any[]) => any;

                                              property inject

                                              inject?: any[];

                                                Type Aliases

                                                type MockFactory

                                                type MockFactory = (token?: InstanceToken) => any;

                                                  Package Files (7)

                                                  Dependencies (1)

                                                  Dev Dependencies (0)

                                                  No dev dependencies.

                                                  Peer Dependencies (4)


                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@nestjs/testing.

                                                  • Markdown
                                                  • HTML
                                                    <a href="https://www.jsdocs.io/package/@nestjs/testing"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>