[$injector:nomod] Module is not available! running karma unit tests


Recently ran into this error in AngularJS regarding module missing when running my Jasmine tests

"[$injector:nomod] Module '' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies  as the second argument"

Turned out that I needed to add the module definition file first before loading the other services that use that module.

karma.conf.js extract


 files: [
            'src/app/module.js',
            'src/app/usingModuleAbove.js'
 ]

Other solutions for this issue can be found in John Papas post here 

Comments

Popular posts from this blog

Angular Testing child component inputs

Grails 3.2: Bootstrap.groovy is not executed when run as an executable war/jar file