我在一家@std/esm
未获批准的公司工作。我的Mocha测试就是这样...
// suite.js
async function wire(){
await import("./Sanity.spec.mjs"); // eslint-disable-line
run();
}
wire();
//Sanity.spec.mjs
import chai from "chai"
describe("My Test", ()=>{
it("Should do what I want", ()=>chai.assert.equal(1,1, "One is in fact 1")); // eslint-disable-line no-self-compare
});
但是当我像nyc mocha --delay --exit ./test/suite.js
一样运行时,我看到了摩卡测试,但是代码覆盖率结果为空。
My Test
√ Should do what I want
When using base App
info: Healthcheck server is listening on 420
√ App should not be null
√ The port should be correct
3 passing (24ms)
----------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files | 0 | 0 | 0 | 0 | |
----------|----------|----------|----------|----------|-------------------|
我省略了其他测试,但是它们确实导入了库。问题是如何使它与NYC一起使用?