shaft
shaft

Reputation: 71

Unit Testing angularjs with jasmine and chutzpah in visual studio2013 wont work

I want to use Chutzpah to run JavaScript unit tests in Visual Studio 2013. As long as I don't reference angular.js the tests will run. Using angular.js those tests won't run and the VS Output gives me the following message:

Error: Error: Instrumentation error, you cannot redefine the 'window' variable in  file:///e:/.../scripts/angular/angular.js:1529
in file:///C:/USERS/.../APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/12.0/EXTENSIONS/MWY50QF4.VGS/TestFiles/Coverage/blanket_jasmine_v2.js.**

Does anyone know about this problem?

Upvotes: 6

Views: 1412

Answers (1)

Matthew Manela
Matthew Manela

Reputation: 16762

This is only an issue if you are running code coverage. This is an issue with Blanket.js (the library Chutzpah uses for code coverage) and Angualr.js conflicting. See this issue for more details: https://github.com/alex-seville/blanket/issues/311

In short, a simple workaround is to use the minified version of Angular.js

Upvotes: 10

Related Questions