rescript-test is a lightweight and performant test framework designed specifically for ReScript projects. Currently at version 8.0.0, it provides a native ReScript API for writing unit and integration tests, leveraging ReScript's type system for robust assertions. It integrates directly into the ReScript build pipeline, running compiled `.bs.js` files. The framework offers core testing primitives like `test`, `testAsync`, and flexible `assertion` functions, alongside utilities for setup/teardown and optional DOM simulation via JSDOM. It aims to provide a straightforward, type-safe testing experience tailored for the ReScript ecosystem, differentiating itself from general JavaScript test runners by its deep integration with ReScript's language features. It appears to be actively maintained, with updates typically correlating with ReScript compiler releases.
Verified import paths — ran on the pinned version, not inferred.
The `retest` command-line interface (CLI) is the primary way to execute tests written with `rescript-test`. The actual testing API (`test`, `assertion`, etc.) is consumed directly within ReScript source files (`.res`) using `open Test` and does not expose direct JavaScript module imports for these functions. Attempting to import or require it in JavaScript code will result in module not found errors for the testing API itself.
Within ReScript source files, the `Test` module is made available via `open Test` at the top of your test file, similar to importing a namespace in other languages. This exposes functions like `test`, `assertion`, `throws`, etc., for use in your ReScript code.
Demonstrates how to install `rescript-test`, configure `bsconfig.json`, write a basic ReScript test file with custom assertions, and execute it using the `retest` CLI.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.