jeudi 23 juillet 2015

(window.beforeEach || window.setup) is not a function

I've tried to setup a testing environment with mocha, phantomjs and istanbul (and grunt). It works great so far, but when it comes to angular-testing i got some problems. I want (and need) to use angular-mocks, but as soon as I include it in my test.html, I get the following console-error in my browser:

Uncaught TypeError: (window.beforeEach || window.setup) is not a function

The matching code in amgular-mocks.js is the following one:

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

This happens both for the current version (1.4.3) and for an old version which apparently worked in another project: 1.3.15.

What am I missing?

Aucun commentaire:

Enregistrer un commentaire