1

尝试使用 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 ==========
4

1 回答 1

7

This is due to an error in blanket.js. See issue for a discussion.

The suggested workaround is to reference the minified version of angular.js, which will resolved the 'window' redefine issue and allow you to run the code coverage in chutzpah.

于 2015-04-17T12:30:30.230 回答