I've encountered an issue while testing an AngularJS application (using Karma and Jasmine) where I manually bootstrap the application in the code after some HTTP AJAX requests.
angular.module("app", []);
angular.element(document).ready(function() {
angular.bootstrap(document, ["app"]);
});
In my Jasmine specs, I have the following code:
beforeEach(module('app'));
However, when I run my specs, I always get the same error:
Error: [$injector:modulerr] Failed to instantiate module app due to
Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to laod it ....
Is there a way to wait for the Angular bootstrap application in the beforeEach function?