UNPKG

@fgv/ts-utils-jest

Version:

Custom matchers for ts-utils result class

19 lines 722 B
import { Result, ResultValueType } from '@fgv/ts-utils'; declare global { namespace jest { interface Matchers<R, T> { /** * Use .toSucceedAndSatisfy to verify that a Result<T> is a success * and that the supplied test function returns true (or void) * for the resulting value * @param test - */ toSucceedAndSatisfy(test: (value: ResultValueType<T>) => boolean | void): R; } } } declare const _default: { toSucceedAndSatisfy: <T>(this: jest.MatcherContext, received: Result<T>, test: (value: T) => boolean | void) => jest.CustomMatcherResult; }; export default _default; //# sourceMappingURL=index.d.ts.map