Skip to content

Commit

Permalink
[Fix] npm test on windows
Browse files Browse the repository at this point in the history
The version of "nyc" (v9) that was being used was not launching `tap` properly on windows. So a dev dependency has been added for the latest nyc (v15), which appears to fix the issue.

Note that version 9 of "nyc" was actually being installed indirectly, as a dependency of "tap". I think using indirect dependencies is a bad idea, and also it appears that newer versions of tap no longer have nyc as a dependency anyway. (Updating tap is a lot more work, so I want to avoid that for now).

Also, the windows shell does not understand single quotes, so an extra npm run script is required.
  • Loading branch information
Joris-van-der-Wel committed Jan 9, 2024
1 parent ce05ec6 commit 6159a6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"js-yaml": "^3.14.0",
"npm-run-posix-or-windows": "^2.0.2",
"npmignore": "^0.3.0",
"nyc": "^15.1.0",
"safe-publish-latest": "^2.0.0",
"tap": "^8.0.1",
"tap-parser": "^5.4.0"
Expand All @@ -80,9 +81,10 @@
"prelint": "npm-run-posix-or-windows eclint",
"lint": "eslint --ext .js,.cjs,.mjs . bin/*",
"pretest": "npm run lint",
"test": "npm run tests-only",
"test": "npm-run-posix-or-windows tests-only",
"posttest": "aud --production",
"tests-only": "nyc tap 'test/*.js'",
"tests-only:windows": "nyc tap test/*.js",
"test:example": "find example -name '*.js' | grep -v fail | grep -v static | xargs tap"
},
"testling": {
Expand Down

0 comments on commit 6159a6a

Please sign in to comment.