Question

Hi I'm getting the following error in webstorm while running karma test run

Error: [$injector:nomod] Module 'ui.bootstrap', 'ui.unique' 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.

i looked in the internet and they said to check dependency file ui.bootstrap might be missed like that.

but the application works fine

and while testing only it shows this error

in my karma.conf.js

files: [
            //angular files

            'app/js/vendor/angular/ui.bootstrap.js',
            'app/js/vendor/angular/ui.bootstrap-0.10.0.js',

            'app/js/vendor/angular/angular.js',
            'app/js/vendor/angular/angular-mocks-0.10.6.js',

            'app/js/app.js',
            'test/**/*Spec.js'
        ], 

in my Module declartion

var myApp = angular.module('myApp', ['ui.bootstrap']);

Could you please help ??

Était-ce utile?

La solution

ui.unique is a module from angular-ui-utils. That has to be included in karma conf and injected to the app as well, if being used.

var myApp = angular.module('myApp', ['ui.bootstrap', 'ui.utils']);

or you can specifically inject ui.unique instead of injecting ui.utils, if only unique module is used.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top