UNPKG

2.23 kBTypeScriptView Raw
1/// <reference types="jest" />
2import execa from 'execa';
3import { ArgList, Arguments, Argv } from '@boost/args';
4import { Path } from '@boost/common';
5import { mockDebugger } from '@boost/debug/test';
6import { ConfigContext, ConfigFile, Context, Driver, DriverContext, DriverContextOptions, DriverMetadata, ScaffoldContext, ScaffoldContextOptions, Script, ScriptContext, ScriptContextOptions, Tool } from '.';
7export { mockDebugger };
8export declare class TestDriver<O extends object = {}> extends Driver<O> {
9 readonly name = "test-driver";
10}
11export declare class TestScript<O extends object = {}> extends Script<O> {
12 readonly name = "test-script";
13 execute(): any;
14}
15export declare function mockConsole<K extends keyof Console>(name: K): jest.SpyInstance;
16export declare function mockToolConfig(): ConfigFile;
17export declare function mockTool(argv?: Argv): Tool;
18export declare function mockDriver<C extends object = {}>(name: string, tool?: Tool | null, metadata?: Partial<DriverMetadata>): Driver<C>;
19export declare function mockScript(name: string, tool?: Tool | null): Script<{}>;
20export declare function stubArgs<T extends object>(options: T, params?: ArgList): Arguments<T>;
21export declare function stubConfigArgs(): Arguments<{}>;
22export declare function stubDriverArgs(fields?: Partial<DriverContextOptions>): Arguments<DriverContextOptions>;
23export declare function stubScaffoldArgs(fields?: Partial<ScaffoldContextOptions>): Arguments<ScaffoldContextOptions>;
24export declare function stubScriptArgs(fields?: Partial<ScriptContextOptions>): Arguments<ScriptContextOptions>;
25export declare function applyContext<T extends Context>(context: T): T;
26export declare function stubConfigContext(): ConfigContext;
27export declare function stubDriverContext(driver?: Driver): DriverContext;
28export declare function stubScriptContext(script?: Script): ScriptContext;
29export declare function stubScaffoldContext(generator?: string, action?: string, name?: string): ScaffoldContext;
30export declare function prependRoot(part: string): Path;
31export declare function getRoot(): Path;
32export declare function stubExecResult(fields?: Partial<execa.ExecaReturnValue>): execa.ExecaReturnValue;
33//# sourceMappingURL=test.d.ts.map
\No newline at end of file