【问题标题】:Unable to get Mocha and Angular mocks to work in Plunker无法让 Mocha 和 Angular 模拟在 Plunker 中工作
【发布时间】:2015-04-02 07:38:19
【问题描述】:

我试图在 plunker 中展示 mocha 的示例,但它给了我角度模拟未定义的问题。我尝试复制和粘贴 bower angular mocks 无济于事。

beforeEach(function(){
  angular.mock.module('plunker');

});

来自 angular-mocks 的错误代码显示窗口未定义

(window.beforeEach || window.setup)(function() {
  annotatedFunctions = [];
  currentSpec = this;
});

Plunker found here

【问题讨论】:

    标签: mocha.js angular-mock plunker


    【解决方案1】:

    您只需将调用下方的角度模拟脚本移动到mocha.setup('bdd');,它就可以正常工作。

    我已经在http://plnkr.co/edit/yH9V6b?p=preview更新了你的plunk

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-18
      • 2015-01-02
      • 1970-01-01
      • 1970-01-01
      • 2018-10-23
      相关资源
      最近更新 更多