Testing modular AngularJS w/ Jasmine & Karma

Often a Unknown Provider error comes from files not being loaded, or being loaded in the incorrect order. Check which files are present while your tests are running.


Such kind of errors mostly occur due to incorrect declaration of files inside karma.config.js file. For setup of karma-jasmine all the files inside file:[] block of karma.config.js file should be in sequence in which they are expected to get loaded. Main module is having dependency injection of any custom service then load that service first and then main module.