bclinkinbeard/angular

How to include angular-mocks

Opened this issue · 0 comments

If I try this:

var angular = require('angular'),
    inject = angular.injector(['ng']).invoke;
require('angular-mocks');

describe('Auth Service', function() {
    var $httpBackend;   
    describe('Login method', function() {
        inject(function(_$httpBackend_, $q) {
                $httpBackend = _$httpBackend_;
                console.log($httpBackend);
        });
    });
});

I get an error that says 'window is not defined', which is coming from requiring angular-mocks. Is there something else I can try so that I can use the $httpBackend service for testing $http?

Thanks