Use for any question or task about property-based or generated-input tests in JavaScript or TypeScript, including quick how-to questions, round-trip checks like decode(encode(x)), and edge cases example tests keep missing: fast-check with fc.assert and fc.property, arbitraries, shrinking and seeds, in Jest, Vitest or Mocha. Has a worked example.
94%
Does it follow best practices?
Impact
98%
1.01xAverage score across 3 eval scenarios
Passed
No findings from the security scan
When a property fails, fast-check prints the falsifying input + a shrunk minimal version + a seed:
Property failed after 47 tests
{ seed: 1234567890, path: "12:1:0", endOnFailure: true }
Counterexample: [{"id": "abc", "age": -1}]
Shrunk 8 time(s)
Got error: Expected age to be >= 18, got -1To reproduce, replay with the seed:
fc.assert(
fc.property(...),
{ seed: 1234567890, path: "12:1:0", endOnFailure: true }
);The seed/path is the deterministic recipe to re-derive the failure.
For CI, set a fixed seed:
import fc from 'fast-check';
fc.configureGlobal({ seed: process.env.CI ? 42 : Date.now() });