← Browse all tools

Go Back
Report Abuse

fast-check

Property-based testing framework for JavaScript and TypeScript

Tool overview

fast-check is a property-based testing framework for JavaScript and TypeScript, in the QuickCheck family. A property states that for all inputs satisfying a precondition, a predicate holds; fast-check generates many inputs to check it and reports a counterexample when it fails.

Generated values come from arbitraries, which can be derived with map and chain while keeping shrinking, so that failures are reduced to a minimal counterexample. Values are biased towards both small and large inputs, preconditions are expressed with fc.pre, and debugging is helped by a verbose mode, replay of the minimal counterexample and custom examples. Model-based testing with commands and detection of race conditions in asynchronous code are also supported. It works with test runners such as Jest, Vitest and Mocha.

fast-check is written in TypeScript and is free and open source under the MIT licence.

Screenshots & video

Community reviews

Login to Write Your Review

There are no reviews yet.

Source & attribution

Original contributor
Jean-Baptiste CROUIGNEAU
External references
https://github.com/dubzzz/fast-check