effect-ts-laws
Version:
effect-ts law testing using fast-check.
35 lines • 1.59 kB
TypeScript
import type { TestAPI } from 'vitest';
import { test } from 'vitest';
import type { Law, UnknownArgs } from '../law.js';
/**
* @internal
*/
export declare const testLawWith: (testApi: TestAPI | (typeof test)["only"]) => <Ts extends UnknownArgs>(law: Law<Ts>) => void;
/**
* Attempts to find a counterexample for the single given {@link law.Law | Law}.
*
* Meant to be called from inside a `Vitest` test suite, perhaps inside some
* `describe()` block, but _not_ inside a `test()`/`it()` block.
*
* [testLaw.skip](https://vitest.dev/api/#test-skip),
* [testLaw.only](https://vitest.dev/api/#test-only),
* [testLaw.skipIf](https://vitest.dev/api/#test-skipif),
* and [testLaw.runIf](https://vitest.dev/api/#test-runif)
* all behave just like their `vitest` counterparts.
*
* See also {@link law.checkLaw | checkLaw}.
* @typeParam Ts - Tuple of types for law predicate arguments.
* @param law - Law under test.
* @property only - Run _only_ this law test and no other.
* @property skip - Skip this law test.
* @property runIf - Run this law test only if the condition holds.
* @property skipIf - Skip this law test only if the condition holds.
* @category vitest
*/
export declare const testLaw: (<Ts extends UnknownArgs>(law: Law<Ts>) => void) & {
skip: <Ts extends UnknownArgs>(law: Law<Ts>) => void;
only: <Ts extends UnknownArgs>(law: Law<Ts>) => void;
skipIf: (condition: unknown) => <Ts extends UnknownArgs>(law: Law<Ts>) => void;
runIf: (condition: unknown) => <Ts extends UnknownArgs>(law: Law<Ts>) => void;
};
//# sourceMappingURL=testLaw.d.ts.map