UNPKG

nest-commander-testing

Version:

A testing utility for nest-commander. It builds on top of ideas from @nestjs/testing and is not tied to any test framework directly.

18 lines (17 loc) 882 B
import { ModuleMetadata } from '@nestjs/common'; import { TestingModule, TestingModuleBuilder } from '@nestjs/testing'; import { CommanderOptionsType } from 'nest-commander'; export type CommandModuleMetadata = Exclude<ModuleMetadata, 'imports'> & { imports: NonNullable<ModuleMetadata['imports']>; }; export declare class CommandTestFactory { private static testAnswers; private static useOriginalInquirer; static useDefaultInquirer(): typeof CommandTestFactory; static createTestingCommand(moduleMetadata: CommandModuleMetadata, options?: CommanderOptionsType): TestingModuleBuilder; private static promptMock; static run(app: TestingModule, args?: string[]): Promise<void>; static runWithoutClosing(app: TestingModule, args?: string[]): Promise<TestingModule>; private static runApplication; static setAnswers(value: any | any[]): void; }