2015-02-10 2 views
0

У меня есть большое угловое приложение, чьи тесты прошли через хрюканную карму/карма-жасмин с самого начала проекта. В последнее время тесты начали проваливаться большую часть времени, и я не могу понять, что происходит не так.угловые тесты кармы/жасмина терпят неудачу при osx

У меня есть git-фиксация, которая работает каждый раз, а следующая не выполняется большую часть времени, а следующие две. Я часами занимался этим, не будучи в состоянии изолировать все, что бы испытания проходили на постоянной основе. Каждый раз, когда я думаю, что нашел то, что срабатывало в тестовом наборе, пытаясь использовать эти знания, некоторые из них позже заканчиваются по ошибке.

Первые 25 тестов всегда проходят нормально, а затем я получаю сообщение об ошибке, которое не приносит много к столу: Error: [$injector:modulerr] Failed to instantiate module app-module-common due to: Error: [$injector:unpr] Unknown provider: http://errors.angularjs.org/1.2.26/$injector/unpr?p0= at /Users/hudson/workspace/app-recast-master/build/js/bottom/vendor/dev/20-angular.js:3802 Странная вещь в этом сообщении, что ни один поставщик не определен как неизвестно.

Это происходит на основе osx, которая отвечает за создание сайта, но не на моем компьютере с Windows.

Вот что karma.conf выглядит следующим образом:

(function() { 
    'use strict'; 

    var exportedConf = require('./build.js'); 
    var userConfig = exportedConf.userConfig; 

    module.exports = function (config) { 

    config.set({ 
     // Karma configuration 

     // base path, that will be used to resolve files and exclude 
     basePath: '', 

     // frameworks to use 
     frameworks: ["jasmine"], 

     // list of files/patterns to load in the browser 
     files: [ 
     '../' + userConfig.build_dir + '/js/top/vendor/dev/**/*.js', 
     //'../' + userConfig.build_dir + '/js/top/project-root/**/*.js', 
     '../' + userConfig.src_dir + '/fragments/config.js', 
     '../' + userConfig.build_dir + '/js/bottom/vendor/dev/**/*.js', 
     '../' + userConfig.build_dir + '/js/bottom/project-root/**/*.js', 
     '../test/mockFactory.js', 
     '../test/jasmineVersionCheck.js', 
     '../' + userConfig.project_dir + '/**/' + userConfig.tests_folderName + '/**/*.spec.js' 
     ], 

     // list of files to exclude 
     exclude: [ 
     ], 

     preprocessors: { 
     // preprocessors are defined at the end of file so that we can use the userConfig variables in the key 
     }, 

     // test results reporter to use 
     reporters: ['progress', 'junit', 'coverage'], 

     coverageReporter: { 
     dir: '../' + userConfig.reports_dir + '/', 
     reporters: [ 
      { 
      type: 'cobertura', 
      file: 'coverage.xml' 
      }, 
      { 
      type: 'html', 
      file: 'coverage.html' 
      } 
     ] 
     }, 


     // web server port 
     port: process.env.KARMA_PORT || 8080, 

     // cli runner port 
     runnerPort: process.env.KARMA_RUNNER_PORT || 9100, 


     junitReporter: { 
     outputFile: '../' + userConfig.reports_dir + '/test-results.xml' 
     }, 



     // enable/disable colors in the output (reporters and logs) 
     colors: process.env.KARMA_COLORS || true, 

     // level of logging 
     // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG 
     logLevel: config.LOG_INFO, 

     // enable/disable watching file and executing tests whenever any file changes 
     autoWatch: false, 

     // Start these browsers, currently available: 
     // - Chrome 
     // - ChromeCanary 
     // - Firefox 
     // - Opera 
     // - Safari (only Mac) 
     // - PhantomJS 
     // - IE (only Windows) 
     browsers: [process.env.KARMA_BROWSER || 'PhantomJS'], 

     // If browser does not capture in given timeout [ms], kill it 
     captureTimeout: 5000, 

     // Continuous Integration mode 
     // if true, it capture browsers, run tests and exit 
     singleRun: true, 

     plugins: ['karma-jasmine', 'karma-phantomjs-launcher', 'karma-junit-reporter', 'karma-coverage'] 


    }); 

    // polyfills need to be excluded or instanbul instrumentation goes wild and screws it all! 
    config.preprocessors['../' + userConfig.build_dir + '/js/bottom/project-root/**/!(*-polyfills)+(.js)'] = ['coverage']; 
    }; 
}()); 

Я надеюсь, что кто-то может дать мне подсказку по этому вопросу, я исчерпал все варианты, которые я мог думать.

ответ

0

Возможно, я действительно говорю, может быть, это может быть связано с именами файлов с верблюдом. IOS не учитывает случай, когда дело касается имен файлов.

Я отредактирую свой ответ, если я смогу прийти к лучшей идее.

+0

Спасибо, но это звучит не очень хорошо. Все вещи считаются: / – mlarcher

Смежные вопросы