8

我在一家@std/esm未经批准的公司工作。我的摩卡测试是这样工作的......

// 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我看到 mocha 测试运行但代码覆盖率结果为空。

  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 |                   |
----------|----------|----------|----------|----------|-------------------|

我忽略了其他测试,但它们确实导入了库。问题是我如何让它与纽约市一起工作?

4

0 回答 0