JSVerify
jsverify.github.io
- Free plan
- Web
- Self-hosted
What JSVerify is
JSVerify is a free property-based testing library for JavaScript, inspired by QuickCheck. Rather than relying only on selected examples, it generates many possible inputs and checks whether a property holds for a function. When a property fails, it attempts to shrink the generated input to a smaller counterexample. Properties can return Promises, which allows asynchronous methods to be tested. JSVerify is framework agnostic; its site names Mocha, nodeunit, and Jasmine as examples. The project README gives `npm install jsverify` as the installation command and points to the GitHub README for API and usage documentation. TypeScript typings are provided, though TypeScript specs cannot use the type DSL. The documented defaults are 100 tests and a maximum generated-value size of 50, and options include test count, maximum size, quiet output, and random generator state. Generated values are deterministic when primitives from the random module are used. The project is maintained by phadej and licensed under MIT. The README cautions that exposed utility functions may change incompatibly, even in patch releases.
Who it suits
JSVerify suits JavaScript developers who want to check function properties across generated inputs, including asynchronous methods. It can fit projects using Mocha, nodeunit, Jasmine, or another test framework.
Good to know, and what to watch
- Shrinks failing generated inputs to smaller counterexamples.
- Properties can return Promises for asynchronous tests.
- Framework agnostic, with Mocha, nodeunit, and Jasmine examples.
- Deterministic generated values when random-module primitives are used.
- TypeScript specs cannot use the type DSL.
- Exposed utility functions may change incompatibly in patch releases.
- No stateful testing support is listed.
Plans
Every plan and priceJSVerify
Free plan
Getting started
- Open https://jsverify.github.io/ for the project site.
- Install the module with npm install jsverify.
- Consult the GitHub README for API and usage guidance.
- Use JSVerify with a test framework such as Mocha, nodeunit, or Jasmine.
Limits to check
The documented defaults are 100 tests and a maximum generated-value size of 50; the check API provides options to adjust both. TypeScript specs cannot use the type DSL.
The Club's review
JSVerify is a free property-based testing library for JavaScript projects, best suited to developers who want generated-input checks without changing test frameworks. Its shrinking and reproducible random runs are useful strengths; TypeScript’s DSL restriction and a warning about utility stability are meaningful trade-offs.
Overview
JSVerify checks whether a property holds across many generated inputs, extending coverage beyond a set of hand-picked examples. When a property fails, it tries to shrink the input to a smaller counterexample, which can make the failure easier to diagnose. Shrinking is an aid to investigation, not a guarantee of a mathematically smallest case, and generated checks complement rather than replace example-based tests.
The default check runs 100 tests with a maximum generated-value size of 50. These are finite checks, not exhaustive proof, but the check API lets teams adjust test count and size, control quiet output, and set the random generator state.
Key features
- Generated property checks: Define behavior that should hold and let JSVerify exercise it against varied inputs. This is especially useful for functions whose edge cases are difficult to enumerate manually.
- Counterexample shrinking: On failure, JSVerify attempts to reduce the generated input. A smaller failing case can make the underlying condition clearer, though the library does not promise that every result is minimal.
- Asynchronous properties: Properties can return Promises, so asynchronous methods can be checked as well as synchronous functions.
- Runner flexibility: JSVerify is framework agnostic; its site names Mocha, nodeunit, and Jasmine as examples. Teams can add property checks without adopting a specific test runner.
- Repeatable runs: Generated values are deterministic when using primitives from the random module, and users can set RNG state. That makes a failing run easier to reproduce under those conditions.
- TypeScript typings: TypeScript is supported, but TypeScript specs cannot use the type DSL. That restriction may make JSVerify less suitable for teams that rely on that DSL in typed tests.
Pricing
JSVerify is free: the JSVerify plan costs nothing and is described as an open-source JavaScript property-based testing library. The repository identifies its license as MIT. There are no paid tiers or seat and quota distinctions to weigh.
Platforms
JSVerify is categorized for self-hosted and web use, and supports JavaScript and TypeScript projects. Installation uses npm install jsverify; the documented runner examples are Mocha, nodeunit, and Jasmine.
Who it's for
JSVerify is a good fit for JavaScript developers who want to probe broad input spaces, test Promise-returning properties, and keep their existing test framework. TypeScript teams can use its typings, but should look elsewhere if using the type DSL in TypeScript specs is essential. The README also warns that exposed utility functions, documented for contributors, may change incompatibly even in patch releases; code that depends on those utilities carries a maintenance risk.
Pros and cons
Pros
- Generated inputs and shrinking help reveal and investigate cases that hand-picked examples may miss.
- Promise-returning properties and framework-agnostic integration suit both asynchronous code and existing test setups.
- Configurable checks and RNG state support tuning run breadth and reproducing failures.
- Free, MIT-licensed availability makes it accessible for projects without a testing-tool budget.
Cons
- TypeScript specs cannot use the type DSL, a practical constraint for teams centered on that syntax.
- Exposed utility functions may change incompatibly even in patch releases, so they are a poor foundation for stable application dependencies.
- Stateful testing is not supported.
Alternatives
For JavaScript and TypeScript property testing, compare JSVerify with fast-check, a free MIT-licensed option also categorized for API, Linux, and web. If the project uses another language, choose by ecosystem: PropCheck is a free MIT-licensed Ruby gem for Ruby 2.5.1 or newer; QCheck is a free BSD-2-Clause OCaml library; Racket QuickCheck is a free package for Racket 6.0 or newer; ScalaCheck is a free BSD-3-Clause library; FsCheck is a free BSD-licensed library distributed as NuGet packages; Gopter is a free MIT-licensed Go property-testing library; and QuickCheck is a free Haskell library for random testing of program properties. Browse the Property-Based Testing Tools list to compare the category.
Verdict
Choose JSVerify if you want a no-cost, framework-agnostic way to exercise JavaScript properties with generated inputs, shrinking, and repeatable random state. Look elsewhere if TypeScript DSL support or stateful testing is a requirement, or if your project depends on the exposed utilities staying compatible between patch releases.
The verdict
JSVerify offers generated-input testing with counterexample shrinking and configurable checks for JavaScript projects. Its TypeScript DSL limitation and the documented stability warning for exposed utilities are worth considering.
Questions people ask
What does JSVerify cost?
The listed plan is free. The pricing model is free, and a free plan is available.
Which languages and test frameworks does it support?
It supports JavaScript and TypeScript. Named framework examples include Mocha, nodeunit, and Jasmine; JSVerify is framework agnostic.
Can JSVerify test asynchronous methods?
Yes. A property can return a Promise, allowing asynchronous methods to be checked.
Does it shrink failing cases and support reproducibility?
Yes. It attempts to find a smaller counterexample when a property fails. Generated values are deterministic when primitives from the random module are used, and RNG state can be set.
Is JSVerify open source, and who maintains it?
The repository identifies its license as MIT. The official site says it is maintained by phadej.
How is JSVerify installed?
The project README instructs users to install it with npm install jsverify.
What the maker publishes
- Async tests
- Properties can return Promises, allowing asynchronous methods to be tested. source
- Async tests
- Properties can be synchronous or return a Promise for asynchronous testing. source
- Configuration
- The check API documents options for test count, maximum generated value size, quiet output, and random generator state. source
- Counterexamples
- When a property fails, JSVerify attempts to find the smallest possible counterexample. source
- Default checks
- The documented default is 100 tests, with a maximum generated-value size of 50. source
- Framework support
- It is framework agnostic and can be used with Mocha, nodeunit, Jasmine, or other testing frameworks. source
- Generated inputs
- JSVerify generates test data so properties can be checked across many possible inputs. source
- Generated tests
- It generates many possible inputs to check properties that should hold for a function. source
- Installation
- The project README instructs users to install the module with npm install jsverify. source
- Integration
- The official site documents installation using npm install jsverify. source
- License
- The GitHub repository identifies the project license as MIT. source
- License
- The GitHub repository identifies the project license as MIT. source
- Maintainer
- The official site says the project is maintained by phadej. source
- Maintenance
- The official site says the project is maintained by phadej. source
- Minimal counterexamples
- When a property fails, JSVerify attempts to find a smaller counterexample by shrinking the generated input. source
- Notable limitation
- The README warns that exposed utility functions are documented for contributions and may change incompatibly even in patch releases. source
- Purpose
- JSVerify is a property-based testing library for JavaScript inspired by QuickCheck. source
- Purpose
- JSVerify is a property-based testing library for JavaScript, inspired by QuickCheck. source
- Reproducibility
- The README says generated values are deterministic when primitives from the random module are used, and documents setting an RNG state. source
- Reproducibility
- The README says test runs can be reproduced using a particular random generator state. source
- Support and documentation
- The official site points users to the GitHub README for API and usage documentation. source
- Test frameworks
- The library is framework agnostic, and its site names Mocha, nodeunit, and Jasmine as examples. source
- TypeScript
- The README says JSVerify provides TypeScript typings, with the limitation that TypeScript specs cannot use the type DSL. source
- TypeScript
- The README says TypeScript specs and provided typings are supported, with the limitation that the type DSL cannot be used in TypeScript specs. source
Checked against the maker's pages on 8 Oct 2026.