Test All Versions

6.2.0 · active · verified Tue Apr 21

The `test-all-versions` package is a Node.js CLI tool designed to run a project's test suite against all published versions of one or more specified npm dependencies. It helps ensure backward compatibility of libraries by automating the arduous process of testing across a matrix of dependency versions. Currently stable at version 6.2.0, the tool is primarily configured via a `.tav.yml` file, allowing for advanced scenarios such as testing against specific Node.js version ranges, handling peer dependencies, running multiple test commands, defining `preinstall`/`pretest`/`posttest` hooks, and configuring environment variable matrices for comprehensive testing. Its release cadence appears active, indicated by its 6.x version, though a specific schedule isn't published. It differentiates itself from general CI/CD solutions by specifically targeting and simplifying dependency version compatibility testing, making it an invaluable tool for library maintainers.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates running tests against multiple versions of the `mysql` and `pg` modules using a `.tav.yml` configuration with environment variables and Node.js version constraints.

/* file: dummy-test.js */
console.log(`Running test for ${process.env.TAV_MODULE_NAME} v${process.env.TAV_MODULE_VERSION} with MYSQL_USER=${process.env.MYSQL_USER ?? 'N/A'}`);
// In a real scenario, you'd import and test the dependency:
// const testedModule = require(process.env.TAV_MODULE_NAME);
// assert.ok(testedModule.someMethod());
process.exit(0); // Simulate passing test

/* file: .tav.yml */
mysql:
  versions: ^2.0.0 || ^3.0.0
  commands: node dummy-test.js
  env:
    - MYSQL_USER=root
    - MYSQL_PASS=secret!
  node: ">=14.0.0"
pg:
  versions: "*"
  commands: node dummy-test.js

/* Run from your terminal */
# First, install test-all-versions locally or globally:
# npm install test-all-versions
# Or use npx for local execution:
npx tav --verbose

view raw JSON →