{"id":13451840,"url":"https://github.com/watson/test-all-versions","last_synced_at":"2025-09-13T17:32:48.492Z","repository":{"id":54277209,"uuid":"61405041","full_name":"watson/test-all-versions","owner":"watson","description":"Run your test suite against all published versions of a dependency","archived":false,"fork":false,"pushed_at":"2024-02-14T08:59:01.000Z","size":172,"stargazers_count":51,"open_issues_count":7,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-02T15:52:34.238Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/watson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-17T22:09:30.000Z","updated_at":"2024-01-29T16:23:34.000Z","dependencies_parsed_at":"2024-01-06T01:54:48.171Z","dependency_job_id":"7179f0ed-a7ee-46b8-a67d-08137d53e8ba","html_url":"https://github.com/watson/test-all-versions","commit_stats":{"total_commits":138,"total_committers":2,"mean_commits":69.0,"dds":0.007246376811594235,"last_synced_commit":"1f5a17d1e528488f28c3243f45898062973eb3d4"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Ftest-all-versions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Ftest-all-versions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Ftest-all-versions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Ftest-all-versions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watson","download_url":"https://codeload.github.com/watson/test-all-versions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232896653,"owners_count":18593521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T07:01:04.327Z","updated_at":"2025-09-13T17:32:48.449Z","avatar_url":"https://github.com/watson.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# test-all-versions\n\nRun your test suite against all published versions of a given\ndependency.\n\n[![npm](https://img.shields.io/npm/v/test-all-versions.svg)](https://www.npmjs.com/package/test-all-versions)\n[![codecov](https://codecov.io/gh/watson/test-all-versions/graph/badge.svg?token=AoH9k0Z4pb)](https://codecov.io/gh/watson/test-all-versions)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\n## Usage\n\nUse the `tav` command to run the tests:\n\n```\n$ tav [options] [\u003cmodule\u003e \u003csemver\u003e \u003ccommand\u003e [args...]]\n```\n\nExample running `node test.js` against all versions of the mysql module\nthat satisfies the `^2.0.0` semver:\n\n```\ntav mysql ^2.0.0 node test.js\n```\n\n### options\n\n- `-h` / `--help` - Output usage info\n- `-v` / `--version` - Output the tav version\n- `-q` / `--quiet` - Don't output stdout from tests unless an error occors\n- `--registry=\u003curl\u003e` - Use a custom registry (e.g. `--registry=https://registry.example.com`)\n- `--verbose` - Output a lot of information while running\n- `--dry-run` - Run in dry-run mode (no tests will be executed)\n- `--compat` - Output just module version compatibility - no errors\n- `--ci` - When running `tav` together with a `.tav.yml` file, use this\n  argument to only run the tests on a CI server. This allows you to add\n  `tav` to your `npm test` command without spending time running tav\n  tests in development.\n\n### .tav.yml\n\nIf `tav` is run without specifying a module, it will instead look for a\n`.tav.yml` file in `cwd` and expect that to contain all its\nconfiguration. This is similar to how Travis CI works with\n`.travis.yml`.\n\nThe following is an example `.tav.yml` file that runs a subset of tests\nagainst all versions of the `mysql` module that satisfies `^2.0.0` and\nall versions of the `pg` module that satisfies `*`:\n\n```yml\nmysql:\n  versions: ^2.0.0\n  commands: tape test/mysql/*.js\npg:\n  versions: \"*\"\n  commands:\n    - node test/pg1.js\n    - node test/pg2.js\n```\n\n#### Node.js version\n\nYou can optionally specify a `node` key in case you want to limit which\nverisons of Node.js the tests for a specific package runs under. The\nvalue must be a valid semver range:\n\n```yml\nmysql:\n  node: \"\u003e=1.0.0\"\n  versions: ^2.0.0\n  commands: node test/mysql.js\n```\n\n#### Peer Dependencies\n\nIf a package or a test needs certain peer dependencies installed in\norder to be able to run, use the `peerDependencies` key. The value can\nbe either a single value like shown below, or a list of values just like\nwith the `commands` key:\n\n```yml\ngraphql-express:\n  peerDependencies: graphql@0.9.2\n  versions: ^0.6.1\n  commands: node test/graphql-express.js\n```\n\n#### Setup and Teardown\n\nIf you need to run a script before or after a command, use the\n`preinstall`, `pretest` and `posttest` keys:\n\n```yml\ngraphql:\n  versions: ^0.7.0\n  preinstall: rm -fr node_modules/graphql-express\n  commands: node test/graphql.js\n```\n\nUsage:\n\n- `preinstall`: runs before `npm install`\n- `pretest`: runs before each command in the `commands` list\n- `posttest`: runs after each comamnd in the `commands` list\n\n#### Multiple test-groups per module\n\nIf you need multiple test-groups for the same module, use `-` to specify\nan array of test-groups:\n\n```yml\nmysql:\n  - versions: ^1.0.0\n    commands: node test/mysql-1x.js\n  - versions: ^2.0.0\n    commands: node test/mysql-2x.js\n```\n\n#### Test matrix\n\nIf you specify environment variables using the `env` key, the test\ncommands will be run once per element in the `env` array. In the\nfollowing example `node test/mysql.js` will run twice for each version\nmatching `^2.0.0` - once with `MYSQL_HOST=server1.example.net\nMYSQL_PWD=secret!` and once with `MYSQL_HOST=server2.example.net`.\n\n```yml\nmysql:\n  env:\n    - MYSQL_HOST=server1.example.net MYSQL_PWD=secret!\n    - MYSQL_HOST=server2.example.net\n  versions: ^2.0.0\n  commands: node test/mysql.js\n```\n\nIf more than one test-case is needed for a given module, the environment\nvariables can shared between them using the following syntax:\n\n```yml\nmysql:\n  env:\n    - MYSQL_HOST=server1.example.net MYSQL_PWD=secret!\n    - MYSQL_HOST=server2.example.net\n  jobs:\n    - versions: ^1.0.0\n      commands: node test/mysql-1x.js\n    - versions: ^2.0.0\n      commands: node test/mysql-2x.js\n```\n\n#### Advanced `versions` usage\n\nThe `versions` field takes two types of arguments:\n\n- A string representing a semver-range (e.g. `^2.0.0`)\n- An object with the following properties:\n  - `include` (required): The semver-range to include in testing. Same effect as the `versions` string.\n  - `exclude` (optional): The semver-range of versions to exclude. Versions matching this range would be removed from the `include` list if present.\n  - `mode` (optional): The way you want to pick versions from the ones resolved based on `include`/`exclude`. Possible values are:\n    - `all` (default): All versions matching the desired range.\n    - `latest-majors`: Only pick the latest version of each major matching the desired range.\n    - `latest-minors`: Only pick the latest version of each minor matching the desired range.\n    - `max-{N}(-\u003calgo\u003e)`: Only pick `N` number of versions within the desired range, where `{N}` is a number larger than `2`. The optional `-\u003calgo\u003e` postfix can be used to specify the algorithm used for picking the versions inbetween. Possible algorithmes are:\n      - `evenly` (default): Evenly space out which versions to pick, always including the first and last version in the desired range.\n      - `random`: Pick `N` versions at random within the desired range.\n      - `latest`: Pick the latest `N` versions within the desired range.\n      - `popular`: Pick the `N` most popular versions based on last weeks download count from npm.\n\n##### Exampels\n\nTest all versions within `^1.0.0`, except `1.2.3`:\n\n```yaml\nmysql:\n  versions:\n    include: ^1.0.0\n    exclude: 1.2.3\n  commands: node test/mysql.js\n```\n\nTest 5 versions in the `^1.0.0` range (evenly spaced within the range):\n\n```yaml\nmysql:\n  versions:\n    include: ^1.0.0\n    mode: max-5\n  commands: node test/mysql.js\n```\n\nTest the 5 most popular versions in the `^1.0.0` range (based on download count within the last week):\n\n```yaml\nmysql:\n  versions:\n    include: ^1.0.0\n    mode: max-5-popular\n  commands: node test/mysql.js\n```\n\n#### External registries\n\nInstall a module from a custom registry (the default is the npm public registry):\n\n```yaml\nmy-custom-module:\n  registry: https://registry.example.com/\n  versions: ^2.0.0\n  commands: node test.js\n```\n\nA registry provided using the command line argument `--registry` takes precedence.\n\n#### Whitelist tests with environment variables\n\nYou can use the enironment variable `TAV` to limit which module from the\n.`tav.yml` file to test:\n\n`TAV=mysql`\n\nThis allows you to create a build-matrix on servers like Travis CI where\neach module in your `.tav.yml` file is tests in an individual build. You\ncan also comma separate multiple names if needed:\n\n`TAV=mysql,pg`\n\nTo see an example of this in action, check out the\n[`.travis.yml`](https://github.com/elastic/apm-agent-nodejs/blob/4d28d248118f734a2b498895f6ac2622c65c85fe/.travis.yml#L104-L105)\nand\n[`.tav.yml`](https://github.com/elastic/apm-agent-nodejs/blob/master/.tav.yml)\nfiles under the [Elastic APM Node.js Agent module](https://github.com/elastic/apm-agent-nodejs).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson%2Ftest-all-versions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatson%2Ftest-all-versions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson%2Ftest-all-versions/lists"}