Skip to content

Commit

Permalink
Document breakage testing in the contributing guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
ericcornelissen committed Oct 21, 2023
1 parent a9c8376 commit 73961bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,19 @@ compatibility tests on all applicable Node.js versions. In the project's
continuous integration the compatibility tests are run for all supported Node.js
versions as well.

#### Breakage Testing

The breakage tests aim to ensure that the API of the library isn't broken from
release to release. All breakage tests go into the `test/breakage/` folder. You
can run the breakage test using the command `npm run test:breakage`.

Breakage test compare both the API itself as well as the behavior of every
function of the API. This is achieved by depending on the latest version of the
library and using it in a differential test for each function in the API.

Unless the API is extended or a breaking API change is necessary this suite does
not need to be updated.

### Writing Tests

Tests can be written in different ways and using different strategies. This
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
"audit:runtime": "better-npm-audit audit --production",
"benchmark": "node bench/bench.js",
"clean": "node script/clean.js",
"coverage": "npm run coverage:unit && npm run coverage:integration && npm run coverage:e2e && npm run coverage:compat",
"coverage": "npm run coverage:unit && npm run coverage:integration && npm run coverage:e2e && npm run coverage:compat && npm run coverage:breakage",
"coverage:breakage": "c8 --config .c8/breakage.json npm run test:breakage",
"coverage:compat": "c8 --config .c8/compat.json npm run test:compat",
"coverage:e2e": "node script/run-platform-coverage.js e2e",
"coverage:e2e:unix": "c8 --config .c8/e2e-unix.json npm run test:e2e",
Expand All @@ -122,7 +123,8 @@
"mutation": "npm run mutation:unit && npm run mutation:integration",
"mutation:integration": "stryker run stryker.integration.config.js",
"mutation:unit": "stryker run stryker.unit.config.js",
"test": "npm run test:unit && npm run test:integration && npm run test:e2e && npm run test:compat",
"test": "npm run test:unit && npm run test:integration && npm run test:e2e && npm run test:compat && npm run test:breakage",
"test:breakage": "ava test/breakage/**/*.test.js",
"test:compat": "ava test/compat/**/*.test.js",
"test:compat-all": "nve 14.18.0,16.13.0,18.0.0,19.0.0,20.0.0 npm run test:compat --ignore-scripts",
"test:e2e": "ava test/e2e/**/*.test.js --timeout 1m",
Expand Down

0 comments on commit 73961bf

Please sign in to comment.