2016-07-25 8 views
0

Unit-Tests instanziiert ... Karma nicht das Hauptmodul meiner App ‚Sicherung‘ genannt finden, die in app.jsKarma nicht mit Karma und Jasmin Haupt App Modul

'fuse':Error: [$injector:nomod] Module 'fuse' 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. http://errors.angularjs.org/1.5.8/$injector/n

definiert ist Ich habe versucht, die Abhängigkeiten in meiner karma.conf.js zu verschieben, und ich habe versucht, browserify oder requirejs als eine mögliche Lösung zu spezifizieren. Nicht sicher, wie genau es weitergehen soll und könnte einen Zeiger in die richtige Richtung verwenden.

Hier ist die Dateistruktur: enter image description here

Und hier ist meine karma.conf Datei:

// Karma configuration 
// Generated on Fri Jul 22 2016 15:18:36 GMT-0500 (CDT) 

module.exports = function(config) { 
    config.set({ 



// base path that will be used to resolve all patterns (eg. files, exclude) 
basePath: '', 


// frameworks to use 
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter 





// list of files/patterns to load in the 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 to exclude 
exclude: [ 
], 


// preprocess matching files before serving them to the browser 
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 
browserify: { 
    watch: true, 
    debug: true 
}, 

preprocessors: { 
    'public/*': ['browserify'] 
}, 


// test results reporter to 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 the output (reporters and 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 and executing tests whenever any 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 the tests and exits 
singleRun: false, 

// Concurrency level 
// how many browser should be started simultaneous 
concurrency: Infinity, 

plugins : [ 
    'karma-requirejs', 
    'karma-jasmine', 
    'karma-chrome-launcher', 
    'karma-firefox-launcher', 
    'karma-browserify' 
], 

frameworks: ['jasmine', 'browserify'] 

    }) 
} 
+0

Was ist spec.js –

+0

Alle meine Testdateien sitzen neben dem Client-Code und enden mit spec –

Antwort

0

'public/app/app.js', ‚public/**/*. spec.js' diese ersetzen durch

spezifischeren Standort

public/app/**/*. js', \

'public/**/*. Spec.js'

Verwandte Themen