小编jul*_*com的帖子

(window.beforeEach || window.setup)不是函数

我试图用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.

我错过了什么?

javascript testing mocha.js phantomjs angularjs

2
推荐指数
1
解决办法
932
查看次数

标签 统计

angularjs ×1

javascript ×1

mocha.js ×1

phantomjs ×1

testing ×1