ngMock function in global scope (module, inject, ...)
Mic75 opened this issue · 3 comments
Hi there,
Thanks for this boilerplate, very handful.
Do you know why the functions from ngMock are not available in the global scope of the spec file ?
For example, if I replace, angular.mock.module('app'); by module('app') (in app.spec.js:9), I am having an error saying that module is undefined.
AngularJS doc say that the function is published on windows for easy access, but it looks like something is going wrong when using when using karma+webpack.
i'm quite sure that webpack is preventing it to patching window object. just use angular.mock.module() instead.
Thanks for the answer. Not quite correct though, since all jasmine functions are available on window (expect, spyOn, ...). It looks like jasmine successfully patch window but not angular.
Maybe something related to the order webpack is loading modules...