ruby on rails - Karma fails to instantiate main app module -
unit testing karma , jasmine...karma can't find main module of app called 'fuse' defined in app.js
'fuse':error: [$injector:nomod] module 'fuse' not available! either misspelled module name or forgot load it. if registering module ensure specify dependencies second argument. http://errors.angularjs.org/1.5.8/$injector/n
i've tried moving around dependencies in karma.conf.js , i've tried specifying browserify or requirejs possible solution. not sure how proceed , use pointer in right direction.
and here karma.conf file:
// karma configuration // generated on fri jul 22 2016 15:18:36 gmt-0500 (cdt) module.exports = function(config) { config.set({ // base path used resolve patterns (eg. files, exclude) basepath: '', // frameworks use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter // list of files / patterns load in browser files: [ //angular mocks 'bower_components/angular/angular.js', 'bower_components/angular-resource/angular-resource.js', 'bower_components/angular-mocs/angular-mocks.js', 'bower_components/angular-resource/angular-resource.js', //test file locations 'public/app/app.js', 'public/**/*.spec.js' ], // list of files exclude exclude: [ ], // preprocess matching files before serving them browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor browserify: { watch: true, debug: true }, preprocessors: { 'public/*': ['browserify'] }, // test results reporter use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress'], // web server port port: 9876, // enable / disable colors in output (reporters , logs) colors: true, // level of logging // possible values: config.log_disable || config.log_error || config.log_warn || config.log_info || config.log_debug loglevel: config.log_info, // enable / disable watching file , executing tests whenever file changes autowatch: true, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['chrome', 'firefox'], // continuous integration mode // if true, karma captures browsers, runs tests , exits singlerun: false, // concurrency level // how many browser should started simultaneous concurrency: infinity, plugins : [ 'karma-requirejs', 'karma-jasmine', 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-browserify' ], frameworks: ['jasmine', 'browserify'] }) }
'public/app/app.js', 'public/**/*.spec.js' replace
more specific location
public/app/**/*.js',\
'public/**/*.spec.js'
Comments
Post a Comment