I believe this problem is caused by the fact that your boot code is included in the karma configuration. I had the same problem.
I took the bootstrap code:
angular.element(document).ready(function() { angular.bootstrap(document, ["app"]); });
and moved it to his own js file called bootstrap.js. Then in my index.html I put a script tag for this at the bottom of the page (after the script where I declare my application module).
<script src="bootstrap.js"></script>
I made sure bootstrap.js was not included in my karma configuration and now my tests pass.
The reason karma was unsuccessful was because it did not need the bootstrap code to run, and the bootstrap code was run by karma so that it would not initialize the application.
source share