找不到跟踪的SourceMap位置:AssertionError(Karma-Typescript)

时间:2019-02-04 15:51:09

标签: typescript karma-runner karma-coverage karma-typescript

我正在使用业力打字稿进行单元测试,并且在期望失败时遇到以下警告:

04 02 2019 15:36:12.927:WARN [reporter]: SourceMap position not found for trace: AssertionError: expected false to be true
    at Object.<anonymous> (base/test/api-client.spec.js?f27f5c9809f69dd36e15c3b125fadb70e6a6487a:61:56)
    at step (base/test/api-client.spec.js?f27f5c9809f69dd36e15c3b125fadb70e6a6487a:32:23)
    at Object.next (base/test/api-client.spec.js?f27f5c9809f69dd36e15c3b125fadb70e6a6487a:13:53)
    at fulfilled (base/test/api-client.spec.js?f27f5c9809f69dd36e15c3b125fadb70e6a6487a:4:58)
HeadlessChrome 71.0.3578 (Mac OS X 10.13.6) When determining an endpoint for service should return the resolved endpoint FAILED
    AssertionError: expected false to be true
        at Object.<anonymous> (test/api-client.spec.ts:23:33 <- test/api-client.spec.js:61:56)
        at step (test/api-client.spec.js:32:23)
        at Object.next (test/api-client.spec.js:13:53)
        at fulfilled (test/api-client.spec.js:4:58)
HeadlessChrome 71.0.3578 (Mac OS X 10.13.6): Executed 1 of 1 (1 FAILED) ERROR (0.608 secs / 0.593 secs)

我的业力配置如下:

module.exports = function (config) {
  config.set({

    frameworks: ["mocha", "karma-typescript"],

    files: [
      { pattern: "src/**/*.ts" },
      { pattern: "test/**/*.ts" }
    ],

    preprocessors: {
      "**/*.ts": ["karma-typescript"]
    },

    reporters: ["dots", "karma-typescript"],

    browsers: ["ChromeHeadless"],

    karmaTypescriptConfig: {
      reports:
      {
        "html": {
          "directory": "coverage",
          "subdirectory": "report"
        },
        "text-summary": ""
      },
      compilerOptions: {
        lib: [
          "es2015",
          "dom"
        ]
      }
    },

    singleRun: true
  });
};

我尝试将sourceMap: true添加到我的editorOptions部分,但是根据业力打字稿文档,这应该已经成立,但这没有什么区别,警告仍然存在。

我配置不正确吗?

谢谢

0 个答案:

没有答案