Runner启动时的实习生Dojo多个错误

时间:2016-11-22 12:27:04

标签: typescript dojo intern istanbul

我正在尝试为使用Dojo和TypeScript构建的正在进行的项目创建功能测试。当我尝试启动intern-runner来启动我的功能测试时,我收到以下错误:

        ReferenceError: __cov_3BgxwjlWVK8G4w9ax1XO$A is not defined
      at Object.<anonymous>  <C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\node_modules\source-map\lib\source-map\source-node.js:5:0>
      at Module._compile  <module.js:570:32>
      at Object.Module._extensions.(anonymous function) [as .js]  <node_modules\intern\node_modules\istanbul\lib\hook.js:107:24>
      at Module.load  <module.js:487:32>

还有这几次:

TypeError: SourceNode is not a constructor
    at toSourceNodeWhenNeeded (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:535:20)
    at generateIdentifier (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:866:16)
    at CodeGenerator.Identifier (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:2244:20)
    at CodeGenerator.generateExpression (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:2427:28)
    at CodeGenerator.MemberExpression (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:1910:28)
    at CodeGenerator.generateExpression (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:2427:28)
    at CodeGenerator.MemberExpression (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:1910:28)
    at CodeGenerator.generateExpression (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:2427:28)
    at CodeGenerator.UpdateExpression (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:2009:26)
    at CodeGenerator.generateExpression (C:\workspaces\QLiveFrontend\P89_Web\node_modules\intern\node_modules\escodegen\escodegen.js:2427:28)

我在哪里查找错误?伊斯坦布尔,实习生,Escodegen还是完全不同的东西?

1 个答案:

答案 0 :(得分:0)

这些错误是由于代码覆盖率工具被插入到它不应该的地方。作为快速修复,您可以通过在实习配置中将excludeInstrumentation设置为true来完全禁用代码覆盖率。更好的解决方法是将excludeInstrumentation设置为排除测试,node_modules,browser_modules等的正则表达式,但允许对实际代码进行检测。