finds.dev

douglascrockford/JSCheck

A random property testing tool for JavaScript

View on GitHub

★ 608JavaScriptupdated Nov 2024

// the take

A minimal QuickCheck-style property testing library for JavaScript, written by Douglas Crockford. Given a spec of generators and a predicate function, it generates random inputs and checks the property holds, useful for testing functions with wide input domains rather than hand-picked examples.

Genuinely tiny footprint - the whole thing is one file, no build step, no dependencies. The generator composition model (integer, string, sequence, one_of, etc. as composable claim functions) is a clean, faithful port of the QuickCheck idea into JS. Public domain license means zero friction to vendor the source directly into a project.

Last meaningful activity is years stale and there's no shrinking of failing cases - when it finds a counterexample you get the raw random input, not a minimal reproduction, which is the single most useful feature of QuickCheck-style tools. No TypeScript types, no npm-idiomatic API (it predates ESM/CommonJS conventions), and no integration story for Jest/Vitest - you're on your own wiring it into a modern test runner. Documentation lives on Crockford's personal site rather than in-repo, so it's easy to end up out of sync with the actual code.

We read the README, the directory tree and a key source file in September 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
608
Forks
62
Language
JavaScript
Last commit
22 Nov 2024

// nearby

If JSCheck isn't quite it.

All repos →