Freedom251 › Property-Based Testing Tools
JSVerify

What JSVerify is
JSVerify is a free, open-source property-based testing library for JavaScript. Rather than relying only on hand-picked examples, it generates inputs and checks whether functions satisfy stated properties. When a property fails, it tries to shrink the generated input to produce a smaller counterexample. Properties may return Promises, allowing asynchronous methods to be checked. The library is framework agnostic, with Mocha, nodeunit, and Jasmine among the named options. Installation uses `npm install jsverify`. JSVerify provides TypeScript typings, though TypeScript specs cannot use its type DSL. Its documented defaults are 100 tests and a maximum generated-value size of 50; check options also cover test count, size, quiet output, and random generator state. Generated values are deterministic when primitives from its random module are used. The project is maintained by phadej and licensed under MIT. Its README warns that exposed utility functions may change incompatibly, even in patch releases.
Who it suits
JSVerify suits JavaScript and TypeScript developers who want generated inputs to check function properties, including asynchronous ones. It can be used with Mocha, nodeunit, Jasmine, or other test frameworks.
What it does well
- Generates many possible inputs for property checks
- Attempts to shrink failing inputs
- Properties can return Promises
- Framework agnostic, including Mocha and Jasmine
- Deterministic values with random-module primitives
What to know first
- TypeScript specs cannot use the type DSL
- Exposed utility functions may change in patch releases
- No stateful testing
Limits
The default check runs 100 tests with a maximum generated-value size of 50. TypeScript specs cannot use the type DSL, and stateful testing is not supported.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| JSVerify | Open-source JavaScript property-based testing library | Free |
As jsverify.github.io lists them, read 8 Oct 2026. The maker's own page has the final word.
Getting started
- Install the module with `npm install jsverify`.
- Add JSVerify properties to a compatible test framework such as Mocha, nodeunit or Jasmine.
- Set the test count, maximum generated-value size, quiet output or random generator state as needed.
- Use the GitHub README for API and usage documentation.
JSVerify is a JavaScript property-based testing library for developers who want to check functions against generated inputs instead of relying only on hand-picked examples. It fits teams already using a JavaScript test runner and those comfortable adding a property-testing layer to existing tests. The free, framework-agnostic package is most compelling when broad input coverage and readable failing cases matter more than stateful testing or a fully unrestricted TypeScript DSL.
Overview
JSVerify generates many possible values and checks whether a property remains true across them. That makes it useful for functions whose behavior changes across a wide input space, where a short list of examples can miss edge cases. It complements example-based tests rather than replacing them, because the documented defaults run 100 checks with a maximum generated-value size of 50 rather than proving a property for every possible input.
When a property fails, the library attempts to shrink the generated value to a smaller counterexample. A reduced case can make debugging more direct and help developers see which condition breaks the property, although shrinking is an attempt and does not promise the mathematically smallest failure. The check API also exposes controls for test count, maximum generated size, quiet output, and random-generator state, so a team can balance run time, exploration breadth, output noise, and repeatability.
Key features
- Generated property checks: JSVerify explores many generated inputs for each stated property. This is a strong fit for parsers, transformations, and other functions with numerous combinations, but it still depends on the properties and generators you define.
- Failing-case shrinking: After a failure, JSVerify tries to reduce the input. Smaller cases generally give a clearer starting point for diagnosis than the original generated value.
- Asynchronous properties: Properties may return Promises, allowing asynchronous methods to be checked in the same property-based style as synchronous code.
- Framework agnostic: The library is designed to work without a required runner and names Mocha, nodeunit, and Jasmine as examples. That flexibility suits projects with an established test stack, while runner-specific conveniences are left to those frameworks.
- Reproducible runs: Generated values are deterministic when primitives from the random module are used, and the API documents setting an RNG state. Replaying a failure is therefore practical when those documented random primitives are part of the setup.
- JavaScript and TypeScript: TypeScript typings are provided, but TypeScript specifications cannot use the type DSL. JavaScript users get the least constrained experience; TypeScript teams should check whether that DSL restriction affects their test design.
- Installation and licensing: The documented installation command is npm install jsverify. The GitHub repository identifies an MIT license, and the project is maintained by phadej.
Pricing
JSVerify has one free plan, JSVerify, priced at free. It is an open-source JavaScript property-based testing library with no paid tier described. That makes it suitable for individual developers and teams that can adopt a package without purchasing seats or allocating a subscription budget. The trade-off is that there is no separate commercial plan described for additional service levels or capabilities.
Platforms
JSVerify is offered for self-hosted and web use and supports JavaScript and TypeScript. Installation is through npm, so it fits projects that manage JavaScript dependencies in their own environments rather than users seeking a standalone desktop application.
Who it's for
Choose JSVerify if you need generated-input testing for JavaScript functions, want shrinking to make failures easier to inspect, or need Promise-returning properties. It is particularly suitable for teams that already use Mocha, nodeunit, Jasmine, or another runner and want to remain free to choose their integration point. It is a weaker fit for projects that require stateful testing, rely heavily on TypeScript's type DSL, or need utility-function compatibility guarantees: the README warns that exposed utility functions are documented for contributions and may change incompatibly even in patch releases.
Pros and cons
Pros
- Broad input exploration: Generated values can expose cases that a small hand-written suite would not cover.
- Actionable failures: Shrinking attempts to turn a complex failing input into a smaller case.
- Asynchronous support: Promise-returning properties cover asynchronous methods as well as synchronous functions.
- Runner independence: You can integrate with multiple JavaScript test frameworks instead of changing runners.
- Free and MIT licensed: There is no stated subscription cost, and the repository uses the MIT license.
Cons
- No stateful testing: The feature set does not include stateful testing, limiting suitability for systems whose correctness depends on operation sequences.
- TypeScript DSL restriction: TypeScript specs cannot use the type DSL, which can constrain typed test authoring.
- Finite defaults: The default 100 checks and size limit of 50 are configurable sampling settings, not exhaustive verification.
- Utility compatibility warning: Exposed utility functions may change incompatibly in patch releases, creating maintenance risk for code that depends on them.
Alternatives
Browse Property-Based Testing Tools for a wider category list. Choose Racket QuickCheck if you need a free Racket package for Linux, macOS, or Windows. ScalaCheck is the free open-source choice for Scala projects, while FsCheck targets .NET users through NuGet packages. Pick fast-check when you want a free MIT-licensed JavaScript/TypeScript option with API, Linux, and web platform listings. Gopter is the free MIT-licensed Go package, and PropCheck is the free MIT-licensed Ruby gem. QCheck is a free BSD-2-Clause OCaml library. Scala Hedgehog is a free open-source Scala testing library.
Verdict
JSVerify is a sound choice for JavaScript developers who want framework-independent property checks, asynchronous support, reproducible runs, and shrinking at no cost. Choose it when generated-input coverage and smaller counterexamples are more valuable than stateful testing or unrestricted TypeScript DSL use. Look elsewhere if those missing capabilities, or the warning about unstable utility functions, are central to your test architecture.
Verdict
JSVerify offers property-based checks, counterexample shrinking, and asynchronous test support without requiring a particular test framework. Its TypeScript DSL limitation and warning about utility-function compatibility are worth considering.
Questions
How much does JSVerify cost?
The listed plan is free. The project is open source under MIT.
Which languages does JSVerify support?
It supports JavaScript and TypeScript. TypeScript specs cannot use the type DSL.
Which test frameworks can use JSVerify?
It is framework agnostic; the site names Mocha, nodeunit and Jasmine as examples.
Does JSVerify shrink failing cases?
Yes. When a property fails, it attempts to find a smaller counterexample by shrinking the generated input.
Can failures be reproduced?
Generated values are deterministic when primitives from the random module are used, and the documentation describes setting RNG state.
What are the default check settings?
The documented default is 100 tests, with a maximum generated-value size of 50.
Facts from JSVerify's own pages
- Async tests
- Properties can be synchronous or return a Promise for asynchronous testing. · github.com, 8 Oct 2026
- Configuration
- The check API documents options for test count, maximum generated value size, quiet output, and random generator state. · github.com, 8 Oct 2026
- Counterexamples
- When a property fails, JSVerify attempts to find the smallest possible counterexample. · jsverify.github.io, 8 Oct 2026
- Default checks
- The documented default is 100 tests, with a maximum generated-value size of 50. · github.com, 7 Oct 2026
- Framework support
- It is framework agnostic and can be used with Mocha, nodeunit, Jasmine, or other testing frameworks. · jsverify.github.io, 8 Oct 2026
- Generated inputs
- JSVerify generates test data so properties can be checked across many possible inputs. · jsverify.github.io, 8 Oct 2026
- Generated tests
- It generates many possible inputs to check properties that should hold for a function. · jsverify.github.io, 7 Oct 2026
- Installation
- The project README instructs users to install the module with npm install jsverify. · github.com, 7 Oct 2026
- Integration
- The official site documents installation using npm install jsverify. · jsverify.github.io, 8 Oct 2026
- License
- The GitHub repository identifies the project license as MIT. · github.com, 8 Oct 2026
- Maintainer
- The official site says the project is maintained by phadej. · jsverify.github.io, 7 Oct 2026
- Maintenance
- The official site says the project is maintained by phadej. · jsverify.github.io, 8 Oct 2026
- Minimal counterexamples
- When a property fails, JSVerify attempts to find a smaller counterexample by shrinking the generated input. · jsverify.github.io, 7 Oct 2026
- Notable limitation
- The README warns that exposed utility functions are documented for contributions and may change incompatibly even in patch releases. · github.com, 8 Oct 2026
- Purpose
- JSVerify is a property-based testing library for JavaScript, inspired by QuickCheck. · jsverify.github.io, 8 Oct 2026
- Reproducibility
- The README says test runs can be reproduced using a particular random generator state. · github.com, 8 Oct 2026
- Support and documentation
- The official site points users to the GitHub README for API and usage documentation. · jsverify.github.io, 8 Oct 2026
- Test frameworks
- The library is framework agnostic, and its site names Mocha, nodeunit, and Jasmine as examples. · jsverify.github.io, 7 Oct 2026
- TypeScript
- The README says TypeScript specs and provided typings are supported, with the limitation that the type DSL cannot be used in TypeScript specs. · github.com, 8 Oct 2026
Where JSVerify stands on Freedom251
- Property-Based Testing Tools#5 of 28