cli-testing-library
Version:
Simple and complete CLI testing utilities that encourage good testing practices.
22 lines (21 loc) • 842 B
TypeScript
import { default as userEvent } from './user-event/index.js';
import { TestInstance } from './types.js';
import { SpawnOptionsWithoutStdio } from 'node:child_process';
import { BoundFunction } from './get-queries-for-instance.js';
import type * as queries from "./queries/index.js";
export interface RenderOptions {
cwd: string;
debug: boolean;
spawnOpts: Omit<SpawnOptionsWithoutStdio, "cwd">;
}
type UserEvent = typeof userEvent;
export type RenderResult = TestInstance & {
userEvent: {
[P in keyof UserEvent]: BoundFunction<UserEvent[P]>;
};
} & {
[P in keyof typeof queries]: BoundFunction<(typeof queries)[P]>;
};
declare function render(command: string, args?: Array<string>, opts?: Partial<RenderOptions>): Promise<RenderResult>;
declare function cleanup(): Promise<void[]>;
export { render, cleanup };