How to use the karma/lib/config.Config 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 imgix / luminous / gulpfile.js View on Github external
function runKarmaTests(configObj, done, singleRun) {
  var config = new Config();
  config.set(configObj);

  if (singleRun !== null) {
    config.singleRun = singleRun;
  }

  new Server(config, function(exitCode) {
    if (exitCode !== 0) {
      throw new gutil.PluginError({
        plugin: "karma",
        message: "Karma tests failed"
      });
    }

    done();
  }).start();
github Viveckh / Veniqa / shopping-webclient / src / assets / drift-zoom / gulpfile.js View on Github external
function runKarmaTests(configObj, done, singleRun) {
  const config = new Config();
  config.set(configObj);

  if (singleRun !== null) {
    config.singleRun = singleRun;
  }

  new Server(config, exitCode => {
    if (exitCode !== 0) {
      throw new gutil.PluginError({ plugin: 'karma', message: 'Karma tests failed' });
    }

    done();
  }).start();
}
github imgix / drift / gulpfile.js View on Github external
function runKarmaTests(configObj, done, singleRun) {
  var config = new Config();
  config.set(configObj);

  if (singleRun !== null) {
    config.singleRun = singleRun;
  }

  new Server(config, function(exitCode) {
    if (exitCode !== 0) {
      throw new gutil.PluginError({
        plugin: "karma",
        message: "Karma tests failed"
      });
    }

    done();
  }).start();
github alexpalombaro / modernizr-webpack-plugin / karma.runner.js View on Github external
var Config = require('karma/lib/config').Config;
var Server = require('karma').Server;
var ModernizrWebpackPlugin = require('./index');

var createConfig = require('./karma.conf');
var karmaConfig = createConfig(new Config());

var webpack = require('webpack');
var webpackConfig = require('./webpack.config');

var path = require('path');

var OUTPUT_JS = 'modernizr-bundle.js';

function _executeTestingServer(source) {
  var config = Object.assign({}, karmaConfig);
  config.files.push(source);
  var server = new Server(config);
  server.start();
}

webpackConfig.plugins = webpackConfig.plugins.filter(function (plugin) {