UNPKG

cli-testing-library

Version:

Simple and complete CLI testing utilities that encourage good testing practices.

14 lines (13 loc) 886 B
import { TestInstance } from '../types.js'; declare class GenericTypeError extends Error { constructor(expectedString: string, received: any, matcherFn: Function, context: any); } type GenericTypeErrorArgs = ConstructorParameters<typeof GenericTypeError>; type AllButFirst<T> = T extends [infer _First, ...infer Rest] ? Rest : never; declare class CliInstanceTypeError extends GenericTypeError { constructor(...args: AllButFirst<GenericTypeErrorArgs>); } type CliInstanceTypeErrorArgs = ConstructorParameters<typeof CliInstanceTypeError>; declare function checkCliInstance(cliInstance: TestInstance, ...args: AllButFirst<CliInstanceTypeErrorArgs>): void; declare function getMessage(context: any, matcher: string, expectedLabel: string, expectedValue: string, receivedLabel: string, receivedValue: string): string; export { CliInstanceTypeError, checkCliInstance, getMessage };