From beb2c6fb057cc448765880428da3092d926364b8 Mon Sep 17 00:00:00 2001 From: Alec Gibson <12036746+alecgibson@users.noreply.github.com> Date: Wed, 9 Sep 2026 07:13:45 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Stop=20hardcoding=20`mocha`=20in?= =?UTF-8?q?ternals=20in=20`test-cover`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs https://github.com/share/sharedb-mingo-memory/pull/46 At the moment, `test-cover` invokes `nyc` and `mocha` by their paths inside `node_modules`, reaching past each package's published binary to a file it merely happens to ship — in `mocha`'s case the private `bin/_mocha`. `mocha@12` deletes that file, so the open bump to it fails CI with `spawn node_modules/mocha/bin/_mocha ENOENT` before a single test runs. npm puts `node_modules/.bin` on `PATH` for scripts, so this change calls both binaries by name, as the neighbouring `test` script already does. `bin/_mocha` existed to run in-process, which is what lets `nyc` see the coverage — but `mocha`'s public binary only forks when node flags are passed, and we pass none, so the generated `lcov.info` is byte-identical. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9075575..b13998d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "lint": "./node_modules/.bin/eslint .", "lint:fix": "npm run lint -- --fix", "test": "mocha", - "test-cover": "node_modules/nyc/bin/nyc.js --temp-dir=coverage -r text -r lcov node_modules/mocha/bin/_mocha" + "test-cover": "nyc --temp-dir=coverage -r text -r lcov mocha" }, "repository": { "type": "git",