bclinkinbeard / angular

AngularJS compiled with jsdom and provided as a CommonJS module. Intended for testing AngularJS code without depending on a browser.
MIT License
54 stars 22 forks source link

angular.mock is not defined #19

Closed j0hnsmith closed 10 years ago

j0hnsmith commented 10 years ago

I'm trying to test an angular app with mocha, from the docs it seems that this should work

var angular = require('angular');

describe('myApp', function() {
    beforeEach(angular.mock.module('myApp'));
});

I'm getting Cannot call method 'module' of undefined

bclinkinbeard commented 10 years ago

ngMock is a separate module that you have to load. https://docs.angularjs.org/api/ngMock