istanbul icon indicating copy to clipboard operation
istanbul copied to clipboard

I can't get Istanbul to work with Mocha (--delay) and ESM

Open jrgleason opened this issue 6 years ago • 1 comments

I have the following mocha command that I run for my tests...

istanbul cover mocha --delay --exit ./test/suite.js

async function wire(){
    await import("./Class.spec");
    ...
    run();
}
wire();

When I run I get...

(node:20108) ExperimentalWarning: The ESM module loader is experimental. I:\Code\praesto-dna\packages\services\packages\callminer\node_modules.bin\mocha.CMD:1 (function (exports, require, module, __filename, __dirname) { @IF EXIST "%~dp0\node.exe" ( ^

SyntaxError: Invalid or unexpected token at new Script (vm.js:79:7)

How do I get this to work with my ESM mocha tests?

jrgleason avatar Apr 25 '19 20:04 jrgleason

Same here please assist?

Aussie15 avatar Aug 30 '19 10:08 Aussie15