fast-check is a free, open-source property-based testing library for JavaScript and TypeScript. It generates inputs, checks specified behavior across many cases, and reduces failures to smaller counterexamples that can help diagnose a problem. Tests use arbitraries to create values, properties to express expected behavior, runners to execute checks, and plugins to extend runners. fast-check works with Jest, Mocha, Vitest, Ava, Bun, Deno, and the Node.js test runner. Users can configure seeds, generated value sizes, time limits, and result reporting globally or per assertion. It supports stateful testing and reproducible failures, and the project describes fuzzing and generative testing for issues such as race conditions and prototype poisoning. The MIT-licensed project also documents an official package for checking specially crafted inputs that might modify global prototypes. Version 5.x requires Node.js 22.12.0 or later and ECMAScript 2025; TypeScript 5.8 or later is optional.
Who it is for
It suits JavaScript and TypeScript developers who want to test behavior across generated inputs, including stateful behavior. Teams using version 5.x should check its listed runtime requirements first.
What is good
- Free and released under the MIT license
- Works with several test runners
- Shrinks failing inputs to counterexamples
- Supports seeds and reproducible failures
What to know first
- Version 5.x requires Node.js 22.12.0 or later
- Version 5.x requires ECMAScript 2025
Freedom251 review
fast-check: the full review
fast-check offers a configurable property-based testing workflow with failure shrinking and broad test-runner support. Its version 5.x runtime requirements may affect adoption in older environments.
fast-check is a property-based testing library for JavaScript and TypeScript, best suited to developers who want generated-input checks inside an existing test runner. Its free, configurable workflow can make edge cases easier to expose and diagnose, but version 5.x requires a recent runtime.
Overview
Rather than relying only on hand-picked examples, fast-check generates many inputs and checks whether they satisfy properties that describe expected behavior. When a check fails, shrinking reduces the input to a smaller counterexample and provides information to help diagnose the problem. That approach is useful when the range of possible inputs is difficult to anticipate; it is a less natural fit for teams seeking only conventional example-based tests.
Key features
Tests combine arbitraries that generate values, properties that define expected behavior, runners that execute checks, and plugins that extend runners. Because fast-check is test-runner agnostic, it can fit workflows using Jest, Mocha, Vitest, Ava, Bun, Deno or the Node.js test runner without requiring a move to a dedicated runner. Official integrations include AVA, Jest and Vitest, and the ecosystem also includes connectors for Zod and io-ts.
Run settings include seeds, generated-value sizes, time limits and result reporting, configurable globally or per assertion. Seeds make failures reproducible, while shrinking helps turn a difficult-to-understand failure into a more focused case. Stateful testing adds another way to exercise behavior over sequences of actions. The project also describes fuzzing and generative testing for issues such as race conditions and prototype poisoning.
The official @fast-check/poisoning package checks whether specially crafted inputs cause global prototype modifications. That gives security-minded teams a focused option for this class of risk, rather than a general guarantee that an application is secure. fast-check 5.x requires Node.js 22.12.0 or later and ECMAScript 2025; TypeScript 5.8 or later is optional. Those requirements can rule it out in older environments. The project is MIT-licensed and welcomes code and non-code contributions, community help and financial support. Its ecosystem can provide stability and maintenance details for official packages, but does not offer specific guarantees for non-official ones.
Pricing
fast-check — 0.00 USD per free: the MIT-licensed JavaScript/TypeScript testing library is open source, with no paid plan or free trial. There are no paid tiers to unlock additional capabilities, so it suits teams looking for a free testing library rather than a hosted service. The trade-off is that the project itself does not provide specific stability or maintenance guarantees for non-official ecosystem packages.
Platforms
fast-check supports API, Linux and web platforms, and targets JavaScript and TypeScript. Its version 5.x runtime requirements are important for teams selecting it: the Node.js minimum is 22.12.0, with ECMAScript 2025 required and TypeScript 5.8 or later optional.
Who it's for
Choose fast-check if your team writes JavaScript or TypeScript, wants to explore behavior across generated inputs, and values shrinking and reproducible failures within an existing test runner. It is particularly relevant when edge cases, stateful behavior or specially crafted inputs are concerns. Look elsewhere if your runtime cannot meet the 5.x requirements, or if your team wants to stay with example-based checks alone.
Pros and cons
- Broad runner compatibility: support for common and alternative runners lets teams add property-based checks without replacing their current test framework.
- More actionable failures: shrinking produces smaller counterexamples, and seeds make failures reproducible.
- Flexible runs: configurable seeds, sizes, time limits and reporting can be set globally or per assertion.
- Current runtime floor: Node.js 22.12.0 or later and ECMAScript 2025 for 5.x may exclude older projects.
- Uneven ecosystem assurances: stability and maintenance details are available for official packages, but specific guarantees do not extend to non-official packages.
Alternatives
For other options, browse Property-Based Testing Tools.
- Gopter is a free MIT-licensed Go property-testing library for readers choosing Go rather than JavaScript or TypeScript.
- Scala Hedgehog is a free open-source Scala testing library for teams working in Scala.
- CsCheck is a free Apache 2 option for readers who prefer that licensing and a self-hosted platform.
- QuickCheck is a free Haskell library for random testing of program properties, making it the relevant choice for Haskell projects.
- Rapid is a free open-source Go library with no dependencies outside Go's standard library.
- Hypothesis is a free alternative for readers whose platform needs include Linux, macOS or Windows.
- RapidCheck is another free option for readers targeting Linux, self-hosted or Windows platforms.
- Proptest is a free alternative for readers looking for a web-platform option.
Verdict
fast-check is a strong fit for JavaScript and TypeScript teams that want property-based coverage, reproducible failures and smaller counterexamples without changing test runners. Its free MIT-licensed library is compelling; the main reason to look elsewhere is the version 5.x runtime floor, especially for projects that cannot move to Node.js 22.12.0 or ECMAScript 2025.
fast-check plans and pricing
All plansCompared on property-based testing tools
- Free plan
- Yes
- Supported languages
- JavaScript, TypeScript
- Test runner support
- Jest, Mocha, Vitest, Ava, Bun, Deno, Node.js test runner
- Failing-case shrinking
- Yes
- Stateful testing
- Yes
- Reproducible failures
- Yes
