Introduction
fast-check is the property-based testing library for JavaScript and TypeScript. Instead of asking you to hand-pick the inputs your tests run on, it generates them for you, runs your assertion over hundreds of cases and shrinks failures down to the smallest inputs that still reproduces them.
This section is the why of fast-check, not the how. Four pages, each answering a question a newcomer usually asks in order:
- What is property-based testing? The core idea, contrasted with the example-based tests you already write.
- Why property-based? The concrete bugs this approach surfaces that example-based tests miss.
- Track record. Real projects and bugs that property-based testing and fast-check specifically have caught.
- Getting started. Installing fast-check and running your first property in your existing test runner.
:::tip Prefer learning by doing? If you would rather skip the theory and open an editor, head straight to the Quick Start tutorial. It walks you through a runnable project step by step. Come back here whenever you want the background. :::
What is Property-Based Testing?
Learn the basic concepts behind the approach.
Getting Started
Get started with fast-check in an existing project.
Why Property-Based Testing?
Learn about the benefits and advantages of property-based testing. If you have never encountered property-based testing before, it is best to start with the definitions in What is Property-Based Testing?.
Track Record
Some examples of key projects with bugs detected by fast-check