`expose-gc` not working after upgrading from mocha 8.x to mocha 9.1.2
See original GitHub issuePrerequisites
test.js
with:
console.log(global.gc)
Description
After upgrading from mocha 8.x to mocha 9.1.2 the old --expose-gc
option (or expose-gc
config item) is not functional anymore.
It seems that at some point along the way that option got renamed to --gc-global
. However the Node.js option is still called --expose-gc
. Passing --gc-global
to mocha results in Node.js being launched with --gc-global
which has no effect.
Steps to Reproduce
mocha --expose-gc ./test.js # absolutely no effect, this option is not recognized anymore
mocha --gc-global ./test.js # launches node with --gc-global which has no effect either
Expected behavior:
node --expose-gc node_modules/mocha/lib/cli/cli.js ./test.js # functional
Versions
mocha 9.1.2 node 14.18.2 Ubuntu 20.04 ts-node 9.1.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
mocha/CHANGELOG.md at master - GitHub
simple, flexible, fun javascript test framework for node.js & the browser - mocha/CHANGELOG.md at master · mochajs/mocha.
Read more >mocha - npm
Start using mocha in your project by running `npm i mocha`. There are 9462 other projects in the npm registry using mocha.
Read more >Mocha - API Manual
Mocha is a feature-rich JavaScript test framework running on Node.js and the browser, making asynchronous testing simple and fun. Mocha tests run serially, ......
Read more >Issue running mocha tests in nodejs - Stack Overflow
This seems like a problem with nyc itself. Try updating to the version suggested in this github issue: ...
Read more >[vscode-go] package.json: update mocha@v9.2.0
Hyang-Ah Hana Kim has uploaded this change for review. View Change package.json: update mo...@v9.2.0 mo...@9.1.2 requires nan...@3.1.25.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Does
mocha -n expose-gc
work? Doesmocha --v8-expose-gc
work?Node accepts both
--gc_global
and--gc-global
, at least with my Node v16.12.0.I have run into this just now as well. I was running mocha like this
and
global.gc
is undefined on mocha9.1.x
but I found the latest version it works at is mocha9.0.3