Grunt Karma hangs forever

I have 2 configurations that I want to test, a wrapper and an application. For technical reasons, they must be separated by configurations. When I run either "grunt karma: app" or "grunt karma: wrapper" I get this:

Running "karma:wrapper" (karma) task
INFO [karma]: Karma v0.12.32 server started at http://localhost:9876/

      

That hangs up endlessly. Bellow is my grunt config:

       karma: {
            app: {
                unit: {
                    configFile: 'test/karma.app.conf.js',
                    singleRun: true
                }
            },
            wrapper: {
                unit: {
                    configFile: 'test/karma.wrapper.conf.js',
                    singleRun: true
                }
            }
        }

      

Below are both karma config files:

application

// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
// Generated on 2015-04-14 using
// generator-karma 0.9.0

module.exports = function(config) {
  'use strict';

  config.set({
    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,

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

    // testing framework to use (jasmine/mocha/qunit/...)
    frameworks: ['jasmine-jquery', 'jasmine'],

    // list of files / patterns to load in the browser
    files: [
      // scripts
      'app.min.js',

      // test files
      '../test/spec/*.app.spec.js'
    ],

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

    // web server port
    port: 8080,

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

    customLaunchers: {
      Chrome_without_security: {
        base: 'Chrome',
        flags: ['--disable-web-security', '--debug']
      }
    },

    // Which plugins to enable
    plugins: [
      'karma-jasmine-jquery',
      'karma-phantomjs-launcher',
      'karma-chrome-launcher',
      'karma-jasmine'
    ],

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

    colors: true,

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

    // Uncomment the following lines if you are using grunt server to run the tests
    proxies: {
       '/': 'http://localhost:9000/'
    }
    // URL root prevent conflicts with the site root
    // urlRoot: '_karma_'
  });
};

      

Packing

// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
// Generated on 2015-04-14 using
// generator-karma 0.9.0

module.exports = function(config) {
  'use strict';

  config.set({
    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

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

    // testing framework to use (jasmine/mocha/qunit/...)
    frameworks: ['jasmine-jquery', 'jasmine'],

    // list of files / patterns to load in the browser
    files: [
      // scripts
      'iWrapper.min.js',

      // test files
      '../test/spec/*.wrapper.spec.js'
    ],

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

    // web server port
    port: 8080,

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

    customLaunchers: {
      Chrome_without_security: {
        base: 'Chrome',
        flags: ['--disable-web-security', '--debug']
      }
    },

    // Which plugins to enable
    plugins: [
      'karma-jasmine-jquery',
      'karma-phantomjs-launcher',
      'karma-chrome-launcher',
      'karma-jasmine'
    ],

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

    colors: true,

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

    // Uncomment the following lines if you are using grunt server to run the tests
//    proxies: {
//       '/': 'http://localhost:9000/'
//    }
    // URL root prevent conflicts with the site root
    // urlRoot: '_karma_'
  });
};

      

+3


source to share





All Articles