首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未找到跟踪的SourceMap位置: AssertionError (Karma-Typescript)

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

Stack Overflow用户
提问于 2019-02-04 23:51:09
回答 0查看 1K关注 0票数 9

我正在使用karma-typescript进行单元测试,当期望失败时,我会遇到以下警告:

代码语言:javascript
复制
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)

我的业力配置如下:

代码语言:javascript
复制
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添加到我的compilerOptions部分,但根据karma-typescript文档,这应该是正确的,但这并没有什么不同,警告仍然存在。

我有什么配置错误吗?

谢谢

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54519696

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档