How to use the karma/lib/config.parseConfig function in karma

To help you get started, we’ve selected a few karma examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mistadikay / doob / test / gulpfile.es6 View on Github external
gulp.task('karma:dev', function(done) {
    const karmaConfigPath = path.resolve('./karma.dev');
    const karmaConfig = parseConfig(karmaConfigPath, {});
    const karmaServer = new Server(
        {
            configFile: karmaConfigPath,
            singleRun: false,
            autoWatch: true,
            reporters: [ 'clear-screen' ].concat(karmaConfig.reporters)
        },
        done
    );

    karmaServer.start();
});
github nhn / tui.color-picker / gulpfile.js View on Github external
gulp.task('default', function(done) {
    var config = karmaConfigParser(path.resolve('karma.conf.js'), {});
    config.singleRun = true;

    KarmaServer.start(config, function(exitCode) {
        gutil.log('Karma has exited with ' + exitCode);
        done();
        process.exit(exitCode);
    });
});
github ExchangeWorld / ExchangeWorld / gulp / tasks / unit.js View on Github external
function runKarma(configFilePath, options, cb) {
	configFilePath = path.resolve(configFilePath);

	var server = karma.server;
	var log = gutil.log;
	var colors = gutil.colors;
	var config = karmaParseConfig(configFilePath, {});

	Object.keys(options).forEach(function(key) {
		config[key] = options[key];
	});

	server.start(config, function(exitCode) {
		log('Karma has exited with ' + colors.red(exitCode));
		cb();
		process.exit(exitCode);
	});
}
github Ciul / angular-facebook / gulpfile.js View on Github external
function runKarma(configFilePath, options, cb) {

  configFilePath = path.resolve(configFilePath);

  var log = gutil.log;
  var colors = gutil.colors;
  var config = karmaParseConfig(configFilePath, {});

  Object.keys(options).forEach(function(key) {
    config[key] = options[key];
  });

  new Server(config, function(exitCode) {
    log('Karma has exited with ' + colors.red(exitCode));
    cb();
    process.exit(exitCode);
  }).start();
}
github PixelsCommander / polymer-native / gulpfile.js View on Github external
function runKarma(configFilePath, options, cb) {

    configFilePath = path.resolve(configFilePath);

    var server = karma.server;
    var log = gutil.log, colors = gutil.colors;
    var config = karmaParseConfig(configFilePath, {});

    Object.keys(options).forEach(function (key) {
        config[key] = options[key];
    });

    server.start(config, function (exitCode) {
        log('Karma has exited with ' + colors.red(exitCode));
        cb();
        process.exit(exitCode);
    });
}
github ionic-team / ionic / scripts / resources / web-animations-js / Gruntfile.js View on Github external
grunt.task.registerMultiTask('sauce', 'Run  tests under Karma on Saucelabs', function() {
    var done = this.async();
    var karmaConfig = require('karma/lib/config').parseConfig(require('path').resolve('test/karma-config-ci.js'), {});
    var config = targetConfig[this.target];
    karmaConfig.files = ['test/karma-setup.js'].concat(config.src, config.test);
    karmaConfig.sauceLabs.testName = 'web-animation-next ' + this.target + ' Unit tests';
    var karmaServer = require('karma').server;
    karmaServer.start(karmaConfig, function(exitCode) {
      done(exitCode === 0);
    });
  });
github MortenHoustonLudvigsen / KarmaTestAdapter / karma-vs-reporter / src / Commands.js View on Github external
logger.setup('INFO', false);
        var log = Util.createLogger(logger);

        var karmaConfig = {
            singleRun: true,
            browsers: [],
            reporters: [],
            colors: false,
            logLevel: 'INFO'
        };

        if (_.isObject(config.config)) {
            karmaConfig = extend(karmaConfig, config.config);
        }

        return cfg.parseConfig(karmaConfigFile, karmaConfig);
    }
github MortenHoustonLudvigsen / KarmaTestAdapter / karma-vs-reporter / src / Util.ts View on Github external
logger.setup('INFO', false);

    var karmaConfig: any = {
        configFile: karmaConfigFile,
        singleRun: true,
        browsers: [],
        reporters: [],
        colors: false,
        logLevel: 'INFO'
    };

    if (_.isObject(config.config)) {
        karmaConfig = extend(karmaConfig, config.config);
    }

    Globals.origConfig = cfg.parseConfig(karmaConfigFile, karmaConfig);
    karmaConfig = extend({}, Globals.origConfig, extensions);
    baseDir = karmaConfig.basePath;
    return karmaConfig;
}
github web-animations / web-animations-js / Gruntfile.js View on Github external
return new Promise(function(resolve) {
      var karmaConfig = require('karma/lib/config').parseConfig(require('path').resolve('test/karma-config.js'), {});
      configCallback(karmaConfig);
      var karmaServer = require('karma').server;
      karmaServer.start(karmaConfig, function(exitCode) {
        resolve(exitCode == 0);
      });
    });
  }