verify-it is a NodeJS library designed for generating randomized property inputs and test data, intended to be used with existing test runners like `node:test`, Mocha, Jest, or Vitest. It operates by delegating test execution to the `it`/`test` and `describe` functions provided by the user's chosen test framework. The current stable version is 2.4.0. The library receives consistent updates, indicated by its recent release history, though a formal release cadence is not explicitly stated. A key differentiator is its focus on *data generation* for single-run test scenarios rather than full property-based testing that explores many permutations, ensuring each test scenario runs once with the requested randomized inputs. It provides a set of built-in generators (`Gen.string`, `Gen.object`, etc.) and allows for easy creation of custom generators. As of v2.4.0, explicit initialization via `init()` is required, deprecating the previously available global `verify` object, which enhances compatibility with various test environments that do not automatically inject globals.
npm install verify-itVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing `verify-it` with `node:test`, defining tests with randomized inputs using built-in (`Gen.string`, `Gen.object`) and custom generators, and showcasing how generated values can be shared across `verify.describe` blocks.
Explicitly initialize the library by importing `init` and calling it with your test framework's `it` (or `test`) and `describe` functions. Example: `import { init } from 'verify-it'; import { it, describe } from 'node:test'; const verify = init({ it, describe });`Initialize `verify-it` by importing the `init` function and passing your test framework's `it` (or `test`) and `describe` functions. Example: `import { init } from 'verify-it'; import test from 'node:test'; const verify = init(test);`No dependency data recorded yet.