You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my .mocharc.json I require an esm module. This is suported since Mocha 8.0.0 (mochajs/mocha#4304) and works fine if I run the tests from the command line.
With the adapter I however get the following error:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: <...>\dkim_verifier@pl\test\helpers\sinonRegisterNode.mjs.js
require() of ES modules is not supported.
require() of <...>\dkim_verifier@pl\test\helpers\sinonRegisterNode.mjs.js from c:\Users\<user>\.vscode\extensions\hbenl.vscode-mocha-test-adapter-2.7.0\out\worker\bundle.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename sinonRegisterNode.mjs.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from <...>\dkim_verifier@pl\package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1192:13)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
at Module.require (internal/modules/cjs/loader.js:1080:19)
at require (internal/modules/cjs/helpers.js:72:18)
at c:\Users\<user>\.vscode\extensions\hbenl.vscode-mocha-test-adapter-2.7.0\out\worker\bundle.js:5645:17
at Generator.next (<anonymous>)
at c:\Users\<user>\.vscode\extensions\hbenl.vscode-mocha-test-adapter-2.7.0\out\worker\bundle.js:88:71
at new Promise (<anonymous>)
at __awaiter (c:\Users\<user>\.vscode\extensions\hbenl.vscode-mocha-test-adapter-2.7.0\out\worker\bundle.js:84:12) {
code: 'ERR_REQUIRE_ESM'
}
As far as I can tell from the Mocha Explorer Log, the new Mocha (8.0.1) locally installed is used:
[2020-07-25 17:17:20.958] [INFO] Worker: Using the mocha package at <...>\dkim_verifier@pl\node_modules\mocha
[2020-07-25 17:17:21.152] [INFO] Worker: Patching Mocha
The text was updated successfully, but these errors were encountered:
In my
.mocharc.json
I require an esm module. This is suported since Mocha 8.0.0 (mochajs/mocha#4304) and works fine if I run the tests from the command line.With the adapter I however get the following error:
As far as I can tell from the Mocha Explorer Log, the new Mocha (8.0.1) locally installed is used:
The text was updated successfully, but these errors were encountered: