簡體   English   中英

在visual studio2013中使用jasmine和chutzpah進行單元測試angularjs無法正常工作

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

我想使用Chutzpah在Visual Studio 2013中運行JavaScript單元測試。只要我不引用angular.js,測試就會運行。 使用angular.js這些測試將不會運行,VS輸出給我以下消息:

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.**

有誰知道這個問題?

如果您正在運行代碼覆蓋,這只是一個問題。 這是Blanket.js(Chutzpah用於代碼覆蓋的庫)和Angualr.js沖突的問題。 有關詳細信息,請參閱此問題: https//github.com/alex-seville/blanket/issues/311

簡而言之,一個簡單的解決方法是使用Angular.js的縮小版本

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM