Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to include angular-mocks #34

Open
mwq27 opened this issue Mar 3, 2015 · 0 comments
Open

How to include angular-mocks #34

mwq27 opened this issue Mar 3, 2015 · 0 comments

Comments

@mwq27
Copy link

mwq27 commented Mar 3, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant