Карма не может создать основной модуль приложения

0

Модульное тестирование с помощью Karma и Jasmine... Карма не может найти основной модуль моего приложения под названием "плавкий предохранитель", который определен в app.js

'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

Я пробовал перемещаться по зависимостям в моем karma.conf.js, и я попытался указать браузеру или requirejs как возможное решение. Не уверен точно, как действовать и может использовать указатель в правильном направлении.

Вот файловая структура: Изображение 174551

И вот мой файл karma.conf:

    // 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
    что такое spec.js
  • 0
    все мои тестовые файлы находятся рядом с клиентским кодом и заканчиваются спецификацией
Теги:
karma-jasmine

1 ответ

0

'public/app/app.js', 'public/**/*. spec.js' заменить это на

более точное местоположение

общественности/приложение/**/*. JS',\

'Общественный/**/*. Spec.js'

Ещё вопросы

Сообщество Overcoder
Наверх
Меню