From bcf6ce793996acd4092bd60c1f99686a73ff048e Mon Sep 17 00:00:00 2001 From: Joris van der Wel Date: Mon, 8 Jan 2024 00:06:00 +0100 Subject: [PATCH] [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. --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 62ea4a7e..fc79f345 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "js-yaml": "^3.14.0", "npm-run-posix-or-windows": "^2.0.2", "npmignore": "^0.3.0", + "nyc": "^10.3.2", "safe-publish-latest": "^2.0.0", "tap": "^8.0.1", "tap-parser": "^5.4.0" @@ -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 node_modules\\tap\\bin\\run.js test/*.js", "test:example": "find example -name '*.js' | grep -v fail | grep -v static | xargs tap" }, "testling": {