You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you use karma-jasmine 0.2.1, which upgraded to Jasmine 2
you call inject inside a spec function.
it('unfortunately throws a TypeError', function () {
inject(function (aService) {
// code...
});
});
TypeError: Cannot read property 'running' of undefined
at isSpecRunning (angular-mocks.js:1923:65)
at window.inject.angular.mock.inject (angular-mocks.js:2087:12)
...
You can work around it by passing the result of inject directly to the it call.
it('works as expected', inject(function (aService) {
// code...
}));
The text was updated successfully, but these errors were encountered:
For Jasmine 2, as near as I can tell, the function passed to beforeEach() is no longer bound to a jasmine instance. (Without binding, it seems like this is now the global object.)
This seems to occur if:
karma-jasmine
0.2.1, which upgraded to Jasmine 2You can work around it by passing the result of
inject
directly to theit
call.The text was updated successfully, but these errors were encountered: