Skip to content

Commit bcf6ce7

Browse files
Joris-van-der-Welljharb
authored andcommittedJan 7, 2024
[Tests] fix npm test on windows
The version of "nyc" (v9) that is being used does not support launching binaries from node_modules/.bin on windows. As a workaround the path to tap's run.js is specified. Newer version of nyc fix this issue, however those versions drop support for older node versions that we still want to support here. Also, the windows shell does not understand single quotes.
1 parent 4a57fbe commit bcf6ce7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"js-yaml": "^3.14.0",
6565
"npm-run-posix-or-windows": "^2.0.2",
6666
"npmignore": "^0.3.0",
67+
"nyc": "^10.3.2",
6768
"safe-publish-latest": "^2.0.0",
6869
"tap": "^8.0.1",
6970
"tap-parser": "^5.4.0"
@@ -80,9 +81,10 @@
8081
"prelint": "npm-run-posix-or-windows eclint",
8182
"lint": "eslint --ext .js,.cjs,.mjs . bin/*",
8283
"pretest": "npm run lint",
83-
"test": "npm run tests-only",
84+
"test": "npm-run-posix-or-windows tests-only",
8485
"posttest": "aud --production",
8586
"tests-only": "nyc tap 'test/*.js'",
87+
"tests-only:windows": "nyc node_modules\\tap\\bin\\run.js test/*.js",
8688
"test:example": "find example -name '*.js' | grep -v fail | grep -v static | xargs tap"
8789
},
8890
"testling": {

0 commit comments

Comments
 (0)
Please sign in to comment.