File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
docs-next/src/content/docs/explainers Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -29,5 +29,7 @@ More information can be found in the [Node.js documentation](https://nodejs.org/
29
29
- [ Watch mode] ( ../running/cli#--watch--w ) does not support ES Module test files
30
30
- [ Custom reporters] ( ../reporters/third-party ) and [ custom interfaces] ( ../interfaces/third-party ) can only be CommonJS files
31
31
- [ Configuration file] ( ../running/configuring ) can only be a CommonJS file (` .mocharc.js ` or ` .mocharc.cjs ` )
32
+ - Mocha in Node.js version 24.4.0 or older [ silently ignored top level errors in ESM files] ( https://github.com/mochajs/mocha/issues/5396 ) .
33
+ If you cannot upgrade to a newer Node.js version, you can add ` --no-experimental-require-module ` to the ` NODE_OPTIONS ` environment variable.
32
34
- When using module-level mocks via libs like ` proxyquire ` , ` rewiremock ` or ` rewire ` , hold off on using ES modules for your test files.
33
35
You can switch to using ` testdouble ` , which does support ESM.
Original file line number Diff line number Diff line change @@ -2131,6 +2131,8 @@ More information can be found in the [Node.js documentation](https://nodejs.org/
2131
2131
- [ Custom reporters] ( #third-party-reporters ) and [ custom interfaces] ( #interfaces )
2132
2132
can only be CommonJS files
2133
2133
- [ Configuration file] ( #configuring-mocha-nodejs ) can only be a CommonJS file (` .mocharc.js ` or ` .mocharc.cjs ` )
2134
+ - Mocha in Node.js version 24.4.0 or older [ silently ignored top level errors in ESM files] ( https://github.com/mochajs/mocha/issues/5396 ) .
2135
+ If you cannot upgrade to a newer Node.js version, you can add ` --no-experimental-require-module ` to the ` NODE_OPTIONS ` environment variable.
2134
2136
- When using module-level mocks via libs like ` proxyquire ` , ` rewiremock ` or ` rewire ` ,
2135
2137
hold off on using ES modules for your test files. You can switch to using ` testdouble ` ,
2136
2138
which does support ESM.
You can’t perform that action at this time.
0 commit comments