Registry / testing / reverse-test

reverse-test

JSON →
library1.1.0jsnpmunverified

The `reverse-test` package is a specialized command-line interface (CLI) tool designed to assist developers in verifying the downstream compatibility of their JavaScript/TypeScript libraries. It functions by programmatically identifying and fetching the top `n` most-downloaded dependents of a given package from the npm registry. Once identified, it then attempts to run the test suites of these dependent packages against the locally developed version of the parent package. This process is crucial for library authors aiming to prevent breaking changes for their consumers before publishing. Currently stable at version 1.1.0, `reverse-test` is likely maintained for compatibility and robustness rather than rapid feature expansion, reflecting a focused release cadence. Its primary differentiation lies in its unique "reverse testing" approach, which proactively checks for breakage from a consumer's perspective, contrasting with typical upstream dependency testing. This makes it an invaluable utility for ensuring ecosystem stability.

npm install reverse-test
INSTALL
IMPORT
SIG · REVERSE-TEST
R
reverse-test
testingjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

reverse-test (global installation)
npm install -g reverse-test
npm install reverse-test
The primary way to use this CLI tool is via global installation, allowing direct execution from the shell. A local installation requires `npx reverse-test` to execute, as it doesn't export any programmatic API.
reverse-test (CLI execution)
reverse-test
node reverse-test
After global installation, execute the tool directly using the `reverse-test` command. It is not designed for direct `node` execution of its internal scripts.
reverse-test -c (specify count)
reverse-test -c 5
reverse-test --count 5
The documented and common flag for specifying the number of dependents to test is `-c`. While some CLIs support long-form flags like `--count`, `-c` is the established pattern for `reverse-test` from its quickstart documentation.

Demonstrates the global installation and basic usage of `reverse-test` to test against the top 3 dependents of the package in the current directory.

npm install -g reverse-test cd /path/to/my/project reverse-test -c 3
reverse-test --version
Debug
Known issues
breakingFuture major versions (e.g., 2.0.0) may refactor CLI arguments. For instance, the `-c` flag for dependent count could be renamed to `--dependents-count`, and the introduction of a positional argument for the target package path might occur.
fix
Always review the release notes for new major versions. Update any automation scripts or personal aliases that rely on specific CLI syntax to reflect changes in flags or argument order.
affects: >=2.0.0
gotchaGlobal CLI installations can sometimes lead to version conflicts or pathing issues if multiple versions of the tool are present or if `npm`'s global bin directory is not correctly configured in the system's PATH environment variable.
fix
Ensure your system's PATH includes `npm root -g`/`npm bin -g`. For precise version control or to avoid global pollution, consider using `npx reverse-test` with a local installation of the package instead of a global one.
affects: all
gotchaThe `reverse-test` tool relies heavily on network access to the npm registry (to find dependents) and potentially GitHub (to clone dependent repositories for testing). Intermittent network issues, npm registry downtime, or API rate limits can cause command failures.
fix
Verify your internet connection and check the status pages for npm and GitHub. For rate limit issues, consider waiting and retrying the command, or adjust your environment if using custom registries.
affects: all
gotchaRunning `reverse-test` can be a time-consuming operation, especially for packages with a large number of dependents or if those dependents have extensive test suites. Each dependent requires cloning and executing its tests.
fix
Use the `-c` flag to limit the number of dependents tested to a manageable count. For comprehensive checks, integrate `reverse-test` into your Continuous Integration/Continuous Deployment (CI/CD) pipelines rather than running it frequently in local development.
affects: all
Errors
Common errors & fixes
command not found: reverse-test
The `reverse-test` package was either not installed globally, or the directory where `npm` places global executables is not included in your system's PATH environment variable.
fix
Run `npm install -g reverse-test` to install the package globally. Alternatively, if installed locally, use `npx reverse-test` to execute it without global installation.
Error: Could not fetch dependent list from npm registry.
This error typically indicates network connectivity problems, a temporary outage or performance issue with the npm registry, or an API rate limit being hit during the attempt to retrieve your package's dependents.
fix
Check your internet connection and confirm the npm registry status (status.npmjs.com). Try running the `reverse-test` command again after a few minutes, or consider if you're behind a corporate proxy or firewall.
Tests failed for dependent `[package-name]`.
One of your package's dependents (specifically `[package-name]`) had its test suite fail when run against the current version of your package. This suggests a potential breaking change or an unforeseen incompatibility introduced in your local modifications.
fix
Examine the detailed test output immediately preceding this error message for `[package-name]` to diagnose the specific failure. You may need to revert changes, adapt your package, or consider this a breaking change for that dependent.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
reverse-test — npm install reverse-test · libregistry