cli-testing-library
Version:
Simple and complete CLI testing utilities that encourage good testing practices.
26 lines (25 loc) • 730 B
text/typescript
import { ChildProcessWithoutNullStreams } from 'node:child_process';
export interface TestInstance {
clear: () => void;
process: ChildProcessWithoutNullStreams;
stdoutArr: Array<{
contents: Buffer | string;
timestamp: number;
}>;
stderrArr: Array<{
contents: Buffer | string;
timestamp: number;
}>;
getStdallStr: () => string;
hasExit: () => null | {
exitCode: number;
};
debug: (maxLength?: number) => void;
}
declare global {
const jest: undefined | any;
const vi: undefined | any;
const afterEach: undefined | ((fn: () => void) => void);
const teardown: undefined | ((fn: () => void) => void);
const expect: undefined | any;
}