TypeScript - jasmine - Chutzpah - AngularJS

半腔热情 提交于 2019-12-22 01:17:18

问题


Hi we are using angulatJs with typescript. For unit testing we are using Jasmine. And to run jasmine we are using Chutzpah.

When i am trying to build project it giving me an error that

ReferenceError: Can't find variable: angular

Where i have added reference to the .spect.ts correctly.

 ///<reference path="../external/angularJS/1.0.8/angular.d.ts" />
 ///<reference path="../external/angularJS/1.0.8/angular-ui.d.ts" />
 ///<reference path="../external/angularJS/1.0.8/angular-mocks.d.ts" />
 ///<reference path="../_references.d.ts" />

But still i am getting the ReferenceError: Can't find variable: angular

Any suggestion ??

Thanks


回答1:


Those references are to the .d.ts file but Chutzpah needs to know where the actual implementation .js files are. You can do this using

/// <chutzpah_reference path="path/to/angular.js" >
/// <chutzpah_reference path="path/to/angular-ui.js" >
/// <chutzpah_reference path="path/to/angular-mock.js" >


来源:https://stackoverflow.com/questions/21435346/typescript-jasmine-chutzpah-angularjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!