我试图用mocha,phantomjs和istanbul(以及grunt)设置测试环境.它到目前为止工作得很好,但是当谈到角度测试时我遇到了一些问题.我想(并且需要)使用角度模拟,但是只要我将其包含在我的test.html中,我的浏览器就会出现以下控制台错误:
Uncaught TypeError: (window.beforeEach || window.setup) is not a function
amgular-mocks.js中的匹配代码如下:
(window.beforeEach || window.setup)(function() {
annotatedFunctions = [];
currentSpec = this;
});
Run Code Online (Sandbox Code Playgroud)
对于当前版本(1.4.3)和显然在另一个项目中工作的旧版本都会发生这种情况:1.3.15.
我错过了什么?