From fc33439ee3d9fe35cb64c88a80c42685695a9d87 Mon Sep 17 00:00:00 2001 From: Joris van der Wel Date: Mon, 8 Jan 2024 00:06:00 +0100 Subject: [PATCH] [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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 62ea4a7e..03a08488 100644 --- a/package.json +++ b/package.json @@ -80,9 +80,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": {