PACKAGE · TESTING

fast-check

Property based testing framework for JavaScript (like QuickCheck)

WEEKLY DOWNLOADS 75.4M
STARS 5.3K
FORKS 218
OPEN ISSUES 58
GZIP SIZE 59.4 kB
UNPACKED SIZE 1.5 MB
DEPENDENCIES 2
LAST UPDATED 11mo ago
DOWNLOAD TRENDS

fast-check downloads · last 12 months

Download trends for fast-check1 download series from Nov 2025 to Oct 2026. Use left and right arrow keys to inspect monthly values.067.6M135.2M202.9M270.5MNov 2025FebMayAugOct 2026
fast-check
ABOUT FAST-CHECK

fast-check is a property-based testing framework for JavaScript, described as a QuickCheck-style tool. Instead of requiring developers to write only individual examples, it generates inputs and checks that a stated property holds across them, helping expose edge cases that hand-picked test data may miss.

Its approach centers tests on general rules about program behavior rather than on a fixed list of expected inputs and outputs. This makes it relevant to JavaScript and TypeScript developers who want to test invariants, transformations, and boundary behavior; its listed topics include fuzzing, generative testing, unit testing, and TDD.

A typical fast-check test defines a property and supplies generated data for it, so the same assertion can be evaluated against multiple inputs. The package information identifies fast-check as a framework but does not specify particular API names, generators, shrinking behavior, or configuration options; consult its documentation before relying on those details in a test design.

fast-check is categorized under Testing and is intended for JavaScript projects, with TypeScript also represented among its topics. It can be used as part of a testing workflow that adds generated cases alongside example-based unit tests, rather than requiring property-based tests to replace existing tests.

The listed unpacked size is 1.5 MB and the reported gzip bundle size is 59.4 kB, useful figures to consider when assessing installation or client-side inclusion. The package reports 73.5M weekly downloads, 5.3K GitHub stars, 218 forks, and 63 open issues; these are supplied project metrics, not guarantees about suitability or support.

Generated tests can reveal failures that are difficult to anticipate, but they do not remove the need to choose meaningful properties and interpret failures. The supplied package information does not describe runtime costs, supported environments, or framework-specific integrations, so verify those requirements against the project documentation before adopting it.

WHEN TO USE
  • When testing a function whose output should satisfy an invariant across many possible inputs, express the invariant as a property and have fast-check supply generated cases.
  • When hand-written examples leave boundary cases uncovered, add property-based tests that explore a broader range of generated JavaScript values.
  • When testing data transformations, check a general relationship between the input and output rather than maintaining a long list of individual input-output examples.
  • When adding generative testing to a JavaScript or TypeScript unit-test workflow, use fast-check alongside existing example-based tests.
  • When practicing test-driven development for behavior that can be stated as a reusable rule, make that rule the property under test and evaluate it against generated inputs.
WHEN NOT TO USE
  • If the required test data must be a small, fixed set of named scenarios, use ordinary example-based unit tests; generated cases may add little value for those assertions.
  • If the behavior cannot be expressed as a clear property or invariant, write focused example tests first rather than generating inputs without a meaningful assertion.
  • If a project requires confirmed APIs for a specific test runner or framework integration, check fast-check's documentation before adopting it; the supplied package details do not name integrations.
  • If the test environment has strict runtime constraints, measure generated-test execution in that environment before adding fast-check, since the supplied information gives no runtime performance figures.
  • If client-side bundle size is a concern, avoid including fast-check in production code without verifying the build output; the reported gzip bundle size is 59.4 kB.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 11
fast-check vs ava ★ 20.8K · 593.9K/wk fast-check vs chai ★ 8.3K · 216.8M/wk fast-check vs mocha ★ 22.9K · 14.5M/wk fast-check vs cypress ★ 51.0K · 7.5M/wk fast-check vs @testing-library/react ★ 19.7K · 98.8M/wk fast-check vs playwright ★ 101.1K · 178.1M/wk fast-check vs vitest ★ 17.5K · 189.7M/wk fast-check vs jest ★ 45.5K · 62.1M/wk fast-check vs selenium-webdriver ★ 34.6K · 2.1M/wk fast-check vs jasmine-core ★ 15.8K · 6.3M/wk fast-check vs nightwatch ★ 12.0K · 131.8K/wk