JSVerify
jsverify.github.io
What it is
JSVerify is a free, open-source property-based testing library for JavaScript, inspired by QuickCheck. It generates inputs and checks whether a stated property holds across them. When a check fails, it attempts to shrink the generated input into a smaller counterexample. Properties can return Promises, allowing asynchronous methods to be tested. JSVerify is framework agnostic; the project names Mocha, nodeunit, and Jasmine as examples. The README instructs users to install it with `npm install jsverify` and says TypeScript typings are provided, though TypeScript specs cannot use the type DSL. Documented defaults are 100 tests and a maximum generated-value size of 50. Options cover test count, maximum generated size, quiet output, and random generator state. Generated values are deterministic when using primitives from the random module, and the RNG state can be set. The project is maintained by phadej and licensed under MIT. Its official site points to the GitHub README for API and usage documentation. The README cautions that exposed utility functions may change incompatibly, including in patch releases.
Spec sheet
- Purpose
- JSVerify is a property-based testing library for JavaScript, inspired by QuickCheck.Read 8 Oct 2026 · jsverify.github.io
- License
- The GitHub repository identifies the project license as MIT.Read 8 Oct 2026 · github.com
- Async tests
- Properties can be synchronous or return a Promise for asynchronous testing.Read 8 Oct 2026 · github.com
- Configuration
- The check API documents options for test count, maximum generated value size, quiet output, and random generator state.Read 8 Oct 2026 · github.com
- Counterexamples
- When a property fails, JSVerify attempts to find the smallest possible counterexample.Read 8 Oct 2026 · jsverify.github.io
- Default checks
- The documented default is 100 tests, with a maximum generated-value size of 50.Read 7 Oct 2026 · github.com
- Framework support
- It is framework agnostic and can be used with Mocha, nodeunit, Jasmine, or other testing frameworks.Read 8 Oct 2026 · jsverify.github.io
- Generated inputs
- JSVerify generates test data so properties can be checked across many possible inputs.Read 8 Oct 2026 · jsverify.github.io
- Generated tests
- It generates many possible inputs to check properties that should hold for a function.Read 7 Oct 2026 · jsverify.github.io
- Installation
- The project README instructs users to install the module with npm install jsverify.Read 7 Oct 2026 · github.com
- Integration
- The official site documents installation using npm install jsverify.Read 8 Oct 2026 · jsverify.github.io
- Maintainer
- The official site says the project is maintained by phadej.Read 7 Oct 2026 · jsverify.github.io
- Maintenance
- The official site says the project is maintained by phadej.Read 8 Oct 2026 · jsverify.github.io
- Minimal counterexamples
- When a property fails, JSVerify attempts to find a smaller counterexample by shrinking the generated input.Read 7 Oct 2026 · jsverify.github.io
- Notable limitation
- The README warns that exposed utility functions are documented for contributions and may change incompatibly even in patch releases.Read 8 Oct 2026 · github.com
- Reproducibility
- The README says test runs can be reproduced using a particular random generator state.Read 8 Oct 2026 · github.com
- Support and documentation
- The official site points users to the GitHub README for API and usage documentation.Read 8 Oct 2026 · jsverify.github.io
- Test frameworks
- The library is framework agnostic, and its site names Mocha, nodeunit, and Jasmine as examples.Read 7 Oct 2026 · jsverify.github.io
- TypeScript
- The README says TypeScript specs and provided typings are supported, with the limitation that the type DSL cannot be used in TypeScript specs.Read 8 Oct 2026 · github.com
Plans and prices
Strong points and limits
Strong points
- Shrinks failing inputs toward smaller counterexamples
- Supports Promise-returning properties
- Framework agnostic, with Mocha, nodeunit, and Jasmine named
- Deterministic generated values with random-module primitives
Limits
- TypeScript specs cannot use the type DSL
- Exposed utility functions may change incompatibly in patch releases
- No stateful testing support
Who it suits
It suits JavaScript developers who want generated inputs to check function properties, including asynchronous ones. It can fit projects using Mocha, nodeunit, Jasmine, or another testing framework.
Verdict
JSVerify provides property-based checks, input shrinking, and configurable test generation without requiring a particular framework. Its TypeScript typings have a DSL limitation, and the README warns that exposed utility functions can change incompatibly.
Where Specifiction places it
- Property-Based Testing Tools#5 of 288.1