️ Repo: Understand why `nyc bin/mocha.js` sometimes gives different behavior than `node bin/mocha.js`
Author: mark-wiemerCreated Aug 9, 2026Updated Sep 19, 2026
Labelsstatus: needs reviewarea: repository tooling
Tooling Suggestion Checklist
- I have tried restarting my IDE and the issue persists.
- I have pulled the latest
mainbranch of the repository. - I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
- I have searched for related issues and issues with the
faqlabel, but none matched my issue. - I want to provide a PR to resolve this
Overview
Some tests are still failing because the nyc cmd primes Node in a way that the mocha cmd doesn't. It's still unclear exactly why this was happening. In the v11.x branch, we successfully added "bare" tests that run directly via node bin/mocha.js to resolve the issue. Ref #5494 and #6156 for context and https://github.com/mochajs/mocha/pull/5498/changes#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519 for the bare test infra.
Source: mochajs/mocha