-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngMock - 1.5.0-beta.2 - Error: [ng:areq] Argument 'fn' is not a function, got string #13397
Comments
Having same issue here, first test works second test throws the above error. |
Hm, strange, The only public changes to ngMock are these two fd83d37 and 51a27c0 @waeljammal Do you also use mocha? |
Yes i use mocha, sinon, chai |
Indeed 51a27c0 modifies The offending line in user code is |
It seems that mocha is reusing the currentSpec context for both specs, whereas Jasmine creates a new context. We should be clearing out the special properties that we added to the spec (see angular.js/src/ngMock/angular-mocks.js Line 2237 in 51a27c0
$providerInjector .
JASMINEhttp://plnkr.co/edit/apJQMAxys2DWizObuYYK?p=preview
MOCHAhttp://plnkr.co/edit/OccCN20WNBZCWMRCKmEV?p=preview
|
I will make a PR - sadly it is rather hard to unit test this! |
My commit (9298344) appears to fix the problem. |
Here you go: #13416 |
I also run into this issue.. Thanks for reporting. |
Upgrading to
1.5.0-beta.2
from1.4.8
I get the following exception:It seems related to the module definition:
beforeEach(module("app"));
I reproduced the issue in this plunker (with
1.4.8
is ok):http://plnkr.co/edit/Y1zGI2rlbCVVDLFRT1mO?p=preview
Weirdly removing a spec, there are two equal specs loaded in
index.html
, the test is ok.Project reference: https://github.com/albertosantini/argo
You can change
karma.conf
accordingly setting1.5.0-beta.2
.The text was updated successfully, but these errors were encountered: