Assemble a set of laws for some unit under test. You can check them using the
functions checkLaw and checkLaws. They can be tested in a
vitest test suite using the
testLaw
and
testLaw
functions.
Example
// A pair of laws with no law sets. constsetA: LawSet = LawSet()( 'some feature under test', Law('law₁', '∀n ∈ ℕ: n = n', tinyPositive)(x=>x === x), Law('law₂', '∀n ∈ ℕ: n ≤ n', tinyPositive)(x=>x <= x), )
// Another that will run “setA” _before_ its own laws constsetA: LawSet = LawSet(setA)( 'another feature under test', Law('law₁', '∀n ∈ ℕ: n - n = 0', tinyPositive)(x=>x - x === 0), )
Assemble a set of laws for some unit under test. You can check them using the functions checkLaw and checkLaws. They can be tested in a vitest test suite using the testLaw and testLaw functions.
Example