使用Chutzpah在Visual Studio中运行代码覆盖时出错

时间:2015-02-24 09:19:15

标签: chutzpah

尝试使用Chutzpah在Visual Studio中运行代码覆盖率,但收到以下错误。

Log Message: waiting for blanket... from     
C:\Users\gorulra\Desktop\Raja\FrontEndTools\FrontEndTools.WebUI.Scripts.Test\Tests123\Services\dataService.spec.js 
Error: Error: Instrumentation error, you cannot redefine the 'window' variable in file:///C:/Users/gorulra/Desktop/Raja/FrontEndTools/FrontEndTools.WebUI.Scripts.Test/Scripts/vendor/js/angular.js:996 in file:///C:/Users/gorulra/AppData/Local/Microsoft/VisualStudio/12.0/Extensions/diby4xuj.1y3/TestFiles/Coverage/blanket_jasmine_v2.js (line 4253)
While Running:C:\Users\gorulra\Desktop\Raja\FrontEndTools\FrontEndTools.WebUI.Scripts.Test\Tests123\Services\dataService.spec.js Error: Error: error loading source script in file:///C:/Users/gorulra/AppData/Local/Microsoft/VisualStudio/12.0/Extensions/diby4xuj.1y3/TestFiles/Coverage/blanket_jasmine_v2.js (line 5141) While Running:C:\Users\gorulra\Desktop\Raja\FrontEndTools\FrontEndTools.WebUI.Scripts.Test\Tests123\Services\dataService.spec.js 
Error: Timeout occurred when executing test file While Running:C:\Users\gorulra\Desktop\Raja\FrontEndTools\FrontEndTools.WebUI.Scripts.Test\Tests123\Services\dataService.spec.js
========== Total Tests: 0 passed, 0 failed, 0 total ==========

1 个答案:

答案 0 :(得分:7)

这是由于blanket.js中的错误造成的。有关讨论,请参阅issue

建议的解决方法是引用angular.js的缩小版本,该版本将解析'窗口'重新定义问题并允许您在chutzpah中运行代码覆盖率。