pict-node wraps Microsoft’s PICT engine so you can generate optimized test suites in JavaScript — fewer cases, strong coverage, ready for your test runner.
Pairwise coverage
Test every meaningful pair of inputs without writing thousands of cases by hand. pict-node generates combinations that catch interaction bugs while keeping the suite small enough to run on every commit.
Fewer tests, same confidence
Six parameters with multiple values each can explode into thousands of combinations. Pairwise testing covers all pairs with a fraction of the cases — practical to run, still effective at finding defects.
TypeScript-first
Define models in code and get typed test cases back. With as const, generated values preserve literal types — so your test loop knows exactly what it’s working with, not just string and number.
Model any input
Use real JavaScript values in your models: strings, numbers, booleans, objects. No string-only DSL unless you want one — the API fits how you already write tests.
Fine-grained control
Exclude invalid combinations with constraints. Pin regression cases with seeding. Group parameters with sub-models. Bias toward important values with weighting. Run negative tests and native PICT models when you need the full power of the underlying engine.
Architecture
pict-node sits between your test suite and Microsoft’s PICT tool: a thin Node.js layer that translates JavaScript models into test cases and hands them back as plain data. The native binary handles combinatorial generation; the library handles ergonomics, types, and integration with modern JS tooling.
Why I built it
PICT is excellent at generating test cases, but using it from Node.js meant shelling out, parsing text, and losing type safety. I wanted a library that feels native to the ecosystem — install it, import it, pass a model, get typed cases — without giving up any of PICT’s capabilities.