fast-check

Property-based testing framework for JavaScript and TypeScript. Generates hundreds of random test cases automatically to find edge cases that example-based tests miss. Inspired by Haskell's QuickCheck. When a failure is found, fast-check automatically shrinks the input to the smallest failing case. Works with Jest, Vitest, Mocha, and any test runner. Used by companies like Docusaurus, material-ui, and fp-ts for invariant testing.

Evaluated Mar 06, 2026 (0d ago) v3.x
Homepage ↗ Repo ↗ Developer Tools javascript typescript testing property-based fuzzing quickcheck invariant generative
⚙ Agent Friendliness
70
/ 100
Can an agent use this?
🔒 Security
98
/ 100
Is it safe for agents?
⚡ Reliability
88
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
88
Error Messages
88
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
90
Secret Handling
100

Local testing library. No external calls. Can help find security edge cases in parsers and validators.

⚡ Reliability

Uptime/SLA
95
Version Stability
85
Breaking Changes
82
Error Recovery
90
AF Security Reliability

Best When

You want to find edge cases in pure functions, parsers, serializers, or data transformations that example-based tests would miss — fast-check generates the cases automatically.

Avoid When

You're testing integration, side effects, or specific business scenarios where exact inputs matter more than invariant coverage.

Use Cases

  • Find edge cases in parsing, serialization, and data transformation functions by generating thousands of random inputs automatically
  • Test mathematical invariants (commutativity, associativity, round-trip serialization) that are hard to express with example tests
  • Verify agent decision logic handles arbitrary inputs correctly without writing hundreds of manual test cases
  • Test TypeScript utility functions and type transformations with randomly generated values across all type boundaries
  • Fuzz test API input validation to find unexpected rejection patterns or acceptance of invalid data

Not For

  • Integration tests requiring specific database state — property-based testing is for pure functions and stateless logic
  • UI/visual testing — fast-check tests logic, not rendered output
  • Teams new to testing who need to learn unit testing first — property-based testing requires understanding invariants

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Testing library. No authentication required.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT license.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Documented

Known Gotchas

  • Arbitrary generators (fc.integer, fc.string, fc.record) must match the function's expected input domain — generating out-of-domain values produces false failures
  • Property assertions must express true invariants — testing 'this specific input gives this output' is example testing, not property testing
  • Async properties require fc.asyncProperty and return a Promise — synchronous property wrapper does not handle async functions
  • Shrinking works by default but can be slow for complex arbitraries — use fast-check's built-in combinators rather than hand-rolling complex generators
  • Default numRuns (100) may miss rare edge cases — increase for critical security or parsing code, decrease for slow integration tests
  • Global seed can be set with fc.configureGlobal({ seed }) for deterministic CI runs — without seed, each run explores different cases

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for fast-check.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered