I am designing the unit tests for an AngularJS web app, using Karma-Jasmine. The web app uses angular-translate and, specifically, employs the $translatePartialLoaderProvider module. The app itself works well; however, the unit tests fail with the following error:
Error: [$injector:modulerr] Failed to instantiate module myApp.view1 due to:
[$injector:unpr] Unknown provider: $translatePartialLoaderProvider
I have followed the unit-testing instructions for angular-translate available at http://ift.tt/1TaBkif, as mentioned in Question #18876290, yet the unit tests still fail with the above-mentioned error.
A code sample illustrating the error is available here (Plunker): http://ift.tt/1TaBkig. Note that the app works well: you can switch views and the view text is translated as expected. As soon as you remove $translatePartialLoaderProvider in view1mod.js, the app passes the test.
Your help would be greatly appreciated!
Aucun commentaire:
Enregistrer un commentaire