Angular + Jasmine: beforeEach () syntax with module ()

Could you explain how this line works:

beforeEach (module ('phonecatApp'));

beforeEach () expects a callback function to call before each test. module () returns an angular.Module object.

What does beforeEach () do with an object?

+4
source share
1 answer

If you look in the source angular.mock.module, you will see that it returns a function or the result of a function, depending on whether the specification works:

window.module = angular.mock.module = function() {
  var moduleFns = Array.prototype.slice.call(arguments, 0);
  return isSpecRunning() ? workFn() : workFn;
  /////////////////////
  function workFn() {
    ...

beforeEach, , , , , , beforeEach.


, . , -, .

+2

All Articles