effect-ts-laws
Version:
effect-ts law testing using fast-check.
30 lines • 1.05 kB
JavaScript
import { buildParameterizedTypeclassLaws } from '../laws.js';
import { testLawSets } from './testLaws.js';
/**
* Test [parameterized type](https://github.com/Effect-TS/effect/blob/main/packages/typeclass/README.md#parameterized-types)
* typeclass laws for the given instances of some datatype.
*
* @typeParam F - Type lambda of the datatype under test.
* @typeParam A - Type lambda of first underlying type.
* @typeParam B - Type lambda of second underlying type.
* @typeParam C - Type lambda of third underlying type.
* @category vitest
*/
export const testParameterizedTypeclassLaws = () => (
/**
* Instances to test. Key is typeclass name and value is the
* instance under test. For example, `{ Monad: Option.Monad }` will run
* the monad typeclass laws on `Option`.
*/
instances,
/**
* Parameterized typeclass test options.
*/
given,
/**
* Optional runtime `fast-check` parameters.
*/
parameters) => {
testLawSets(parameters)(...buildParameterizedTypeclassLaws()(instances, given));
};
//# sourceMappingURL=parameterized.js.map