@nestjs/testing

  • Version 10.3.3
  • Published
  • 34.3 kB
  • 1 dependency
  • MIT license

Install

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

Overview

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

Index

Classes

class Test

class Test {}

    method createTestingModule

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

      class TestingModule

      class TestingModule extends NestApplicationContext {}

      constructor

      constructor(
      container: NestContainer,
      graphInspector: GraphInspector,
      contextModule: Module,
      applicationConfig: ApplicationConfig,
      scope?: Type<any>[]
      );

        property graphInspector

        protected readonly graphInspector: GraphInspector;

          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

              constructor(metadataScanner: MetadataScanner, metadata: ModuleMetadata);

                method compile

                compile: (
                options?: Pick<NestApplicationContextOptions, 'snapshot' | 'preview'>
                ) => 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 overrideModule

                        overrideModule: (moduleToOverride: ModuleDefinition) => OverrideModule;

                          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;

                                  Interfaces

                                  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?: InjectionToken) => any;

                                              Package Files (7)

                                              Dependencies (1)

                                              Dev Dependencies (0)

                                              No dev dependencies.

                                              Peer Dependencies (4)

                                              Badge

                                              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
                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@nestjs/testing)
                                              • 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>