<commit_before>// Karma configuration
// Generated on Sat Sep 05 2015 12:00:17 GMT+0200 (CEST)

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
        frameworks: ['jasmine', 'sinon', 'requirejs'],

        // list of files / patterns to load in the browser
        files: [
            'test-main.js', {
                pattern: 'specs/*.js',
                included: false
            }, {
                pattern: 'app/*.js',
                included: false
            }, {
                pattern: 'app/workers/*.js',
                included: false
            }, {
                pattern: 'node_modules/jquery/dist/*.min.js',
                included: false
            }
        ],

        // list of files to exclude
        exclude: [
            'app/config.js'
        ],

        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {
            'app/*.js': ['coverage'],
            'app/workers/*.js': ['coverage']
        },

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: ['spec', 'coverage'],

        // 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'],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: false,

        // optionally, configure the reporter
        coverageReporter: {
            type: 'html',
            dir: 'coverage/'
        }
    });
};
<commit_msg>karma.conf.js imrpoved<commit_after>// Karma configuration
// Generated on Sat Sep 05 2015 12:00:17 GMT+0200 (CEST)

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
        frameworks: ['jasmine', 'sinon', 'requirejs'],

        // list of files / patterns to load in the browser
        files: [
            'test-main.js', {
                pattern: 'specs/*.js',
                included: false
            }, {
                pattern: 'app/*.js',
                included: false
            }, {
                pattern: 'app/workers/*.js',
                included: false
            }, {
                pattern: 'node_modules/jquery/dist/*.min.js',
                included: false
            }
        ],

        // list of files to exclude
        exclude: [
            'app/config.js'
        ],

        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {
            'app/app.js': ['coverage'],
            'app/buttons.js': ['coverage'],
            'app/components.js': ['coverage'],
            'app/consts.js': ['coverage'],
            'app/events.js': ['coverage'],
            'app/utils.js': ['coverage'],
            'app/workers/enemyWorker.js': ['coverage'],
            'app/workers/userEnemyShots.js': ['coverage']
        },

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: ['spec', 'coverage'],

        // 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'],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: false,

        // optionally, configure the reporter
        coverageReporter: {
            type: 'html',
            dir: 'coverage/'
        }
    });
};
<|endoftext|>


<commit_before>_RESTstop = function() {
  this._routes = [];
  this._config = {
    use_auth: false,
    api_path: '/api',
    pretty_json: false,
    bodyParser: {},
    onLoggedIn: function() {},
    onLoggedOut: function() {}
  };
  this._started = false;
  this._configured = false;
};

// simply match this path to this function
_RESTstop.prototype.add = function(path, options, endpoint)  {
  var self = this;

  if(path[0] != "/") path = "/" + path;

  // Start serving on first add() call
  if(!this._started){
    this._start();
  }

  if (_.isObject(path) && ! _.isRegExp(path)) {
    _.each(path, function(endpoint, p) {
      self.add(p, endpoint);
    });
  } else {
    if (! endpoint) {
      // no options were supplied so 2nd parameter is the endpoint
      endpoint = options;
      options = null;
    }
    if (! _.isFunction(endpoint)) {
      endpoint = _.bind(_.identity, null, endpoint);
    }
    self._routes.push([new RESTstop.Route(self._config.api_path, path, options), endpoint]);
  }
};

_RESTstop.prototype.match = function(request, response) {
  for (var i = 0; i < this._routes.length; i++) {
    var params = {}, route = this._routes[i];

    if (route[0].match(request.url, request.method, params)) {
      context = {request: request, response: response, params: params};

      var args = [];
      for (var key in context.params)
        args.push(context.params[key]);

      if(request.method == "POST" || request.method == "PUT") {
        _.extend(context.params, request.body);
      }
      if(request.method == "GET" || _.size(request.query)) {
        _.extend(context.params, request.query);
      }

      if(this._config.use_auth) {
        context.user = false;

        var userId = context.params.userId;
        var loginToken = context.params.loginToken;

        if(request.headers['x-login-token']) {
          loginToken = request.headers['x-login-token'];
        }
        if(request.headers['x-user-id']) {
          userId = request.headers['x-user-id'];
        }

        // Get the user object
        if(userId && loginToken) {
          context.user = Meteor.users.findOne({
            _id: userId,
            "services.resume.loginTokens.token": loginToken
          });
        }

        // Return an error if no user and login required
        if(route[0].options.require_login && !context.user) {
          return [403, {success: false, message: "You must be logged in to do this."}];
        }
      }

      try {
        return route[1].apply(context, args);
      } catch (e) {
        return [e.error || 404, {success: false, message: e.reason || e.message}];
      }
    }
  }
  return false;
};

_RESTstop.prototype.configure = function(config){
  if(this._configured){
    throw new Error("RESTstop.configure() can only be called once");
  }

  this._configured = true;

  _.extend(this._config, config);

  if(this._config.api_path[0] != "/") {
    this._config.api_path = "/"  +this._config.api_path;
  }

  RoutePolicy.declare('/' + this._config.api_path + '/', 'network');

  for (var i = 0; i< this._routes.length; i++) {
    var route = this._routes[i]
      , newRoute = [
          new RESTstop.Route(this._config.api_path, route[0].originalPath, route[0].options),
          route[1]
        ];

    this._routes[i] = newRoute;
  }

  if(this._config.use_auth) {
    RESTstop.initAuth();
  }
};

_RESTstop.prototype._start = function(){
  var self = this;

  if(this._started){
    throw new Error("RESTstop has already been started");
  }

  this._started = true;

  // hook up the serving
  var self = this,
      connect = Npm.require("connect");

  WebApp.connectHandlers.use(connect.query());
  WebApp.connectHandlers.use(connect.bodyParser(this._config.bodyParser));
  WebApp.connectHandlers.use(function(req, res, next) {
    if (req.url.slice(0, self._config.api_path.length) !== self._config.api_path) {
      return next();
    }

    // need to wrap in a fiber in case they do something async
    // (e.g. in the database)
    if(typeof(Fiber)=="undefined") Fiber = Npm.require('fibers');

    Fiber(function() {
      res.statusCode = 200; // 200 response, by default
      var output = RESTstop.match(req, res);

      if (output === false) {
        output = [404, {success: false, message:'API method not found'}];
      }

      // parse out the various type of response we can have

      // array can be
      // [content], [status, content], [status, headers, content]
      if (_.isArray(output)) {
        // copy the array so we aren't actually modifying it!
        output = output.slice(0);

        if (output.length === 3) {
          var headers = output.splice(1, 1)[0];
          _.each(headers, function(value, key) {
            res.setHeader(key, value);
          });
        }

        if (output.length === 2) {
          res.statusCode = output.shift();
        }

        output = output[0];
      }

      if (_.isNumber(output)) {
        res.statusCode = output;
        output = '';
      }

      if(_.isObject(output)) {
        if (self._config.pretty_json) {
          output = JSON.stringify(output, null, "  ");
        } else {
          output = JSON.stringify(output);
        }
        res.setHeader("Content-Type", "text/json");
      }

      return res.end(output);
    }).run();
  });
};

_RESTstop.prototype.call = function (context, name, args) {
  var args = Array.prototype.slice.call(arguments, 2);
  return this._apply(context, name, args, 'method_handlers');
};

_RESTstop.prototype.apply = function (context, name, args) {
  return this._apply(context, name, args, 'method_handlers');
};

_RESTstop.prototype.getPublished = function (context, name, args) {
  return this._apply(context, name, args, 'publish_handlers');
};

MethodInvocation = function (options) {
  var self = this;

  // true if we're running not the actual method, but a stub (that is,
  // if we're on a client (which may be a browser, or in the future a
  // server connecting to another server) and presently running a
  // simulation of a server-side method for latency compensation
  // purposes). not currently true except in a client such as a browser,
  // since there's usually no point in running stubs unless you have a
  // zero-latency connection to the user.
  this.isSimulation = options.isSimulation;

  // call this function to allow other method invocations (from the
  // same client) to continue running without waiting for this one to
  // complete.
  this._unblock = options.unblock || function () {};
  this._calledUnblock = false;

  // current user id
  this.userId = options.userId;

  // sets current user id in all appropriate server contexts and
  // reruns subscriptions
  this._setUserId = options.setUserId || function () {};

  // used for associating the connection with a login token so that the
  // connection can be closed if the token is no longer valid
  this._setLoginToken = options._setLoginToken || function () {};

  // Scratch data scoped to this connection (livedata_connection on the
  // client, livedata_session on the server). This is only used
  // internally, but we should have real and documented API for this
  // sort of thing someday.
  this._sessionData = options.sessionData;
};

_.extend(MethodInvocation.prototype, {
  unblock: function () {
    var self = this;
    self._calledUnblock = true;
    self._unblock();
  },
  setUserId: function(userId) {
    var self = this;
    if (self._calledUnblock)
      throw new Error("Can't call setUserId in a method after calling unblock");
    self.userId = userId;
    self._setUserId(userId);
  },
  _setLoginToken: function (token) {
    this._setLoginToken(token);
    this._sessionData.loginToken = token;
  },
  _getLoginToken: function (token) {
    return this._sessionData.loginToken;
  }
});

_RESTstop.prototype._apply = function (context, name, args, handler_name) {
  var self = Meteor.default_server;

  // Run the handler
  var handler = self[handler_name][name];
  var exception;
  if (!handler) {
    exception = new Meteor.Error(404, "Method not found");
  } else {

    var userId = context.user ? context.user._id : null;
    var setUserId = function() {
      throw new Error("Can't call setUserId on a server initiated method call");
    };

    var invocation = new MethodInvocation({
      isSimulation: false,
      userId: userId,
      setUserId: setUserId,
      sessionData: self.sessionData
    });

    try {
      var result = DDP._CurrentInvocation.withValue(invocation, function () {
        return maybeAuditArgumentChecks(
          handler, invocation, args, "internal call to '" + name + "'");
      });
    } catch (e) {
      exception = e;
    }
  }

  if (exception)
    throw exception;
  return result;
};

var maybeAuditArgumentChecks = function (f, context, args, description) {
  args = args || [];
  if (Package['audit-argument-checks']) {
    return Match._failIfArgumentsAreNotAllChecked(
      f, context, args, description);
  }
  return f.apply(context, args);
};

// Make the router available
RESTstop = new _RESTstop();
<commit_msg>added check for already existing content-type header<commit_after>_RESTstop = function() {
  this._routes = [];
  this._config = {
    use_auth: false,
    api_path: '/api',
    pretty_json: false,
    bodyParser: {},
    onLoggedIn: function() {},
    onLoggedOut: function() {}
  };
  this._started = false;
  this._configured = false;
};

// simply match this path to this function
_RESTstop.prototype.add = function(path, options, endpoint)  {
  var self = this;

  if(path[0] != "/") path = "/" + path;

  // Start serving on first add() call
  if(!this._started){
    this._start();
  }

  if (_.isObject(path) && ! _.isRegExp(path)) {
    _.each(path, function(endpoint, p) {
      self.add(p, endpoint);
    });
  } else {
    if (! endpoint) {
      // no options were supplied so 2nd parameter is the endpoint
      endpoint = options;
      options = null;
    }
    if (! _.isFunction(endpoint)) {
      endpoint = _.bind(_.identity, null, endpoint);
    }
    self._routes.push([new RESTstop.Route(self._config.api_path, path, options), endpoint]);
  }
};

_RESTstop.prototype.match = function(request, response) {
  for (var i = 0; i < this._routes.length; i++) {
    var params = {}, route = this._routes[i];

    if (route[0].match(request.url, request.method, params)) {
      context = {request: request, response: response, params: params};

      var args = [];
      for (var key in context.params)
        args.push(context.params[key]);

      if(request.method == "POST" || request.method == "PUT") {
        _.extend(context.params, request.body);
      }
      if(request.method == "GET" || _.size(request.query)) {
        _.extend(context.params, request.query);
      }

      if(this._config.use_auth) {
        context.user = false;

        var userId = context.params.userId;
        var loginToken = context.params.loginToken;

        if(request.headers['x-login-token']) {
          loginToken = request.headers['x-login-token'];
        }
        if(request.headers['x-user-id']) {
          userId = request.headers['x-user-id'];
        }

        // Get the user object
        if(userId && loginToken) {
          context.user = Meteor.users.findOne({
            _id: userId,
            "services.resume.loginTokens.token": loginToken
          });
        }

        // Return an error if no user and login required
        if(route[0].options.require_login && !context.user) {
          return [403, {success: false, message: "You must be logged in to do this."}];
        }
      }

      try {
        return route[1].apply(context, args);
      } catch (e) {
        return [e.error || 404, {success: false, message: e.reason || e.message}];
      }
    }
  }
  return false;
};

_RESTstop.prototype.configure = function(config){
  if(this._configured){
    throw new Error("RESTstop.configure() can only be called once");
  }

  this._configured = true;

  _.extend(this._config, config);

  if(this._config.api_path[0] != "/") {
    this._config.api_path = "/"  +this._config.api_path;
  }

  RoutePolicy.declare('/' + this._config.api_path + '/', 'network');

  for (var i = 0; i< this._routes.length; i++) {
    var route = this._routes[i]
      , newRoute = [
          new RESTstop.Route(this._config.api_path, route[0].originalPath, route[0].options),
          route[1]
        ];

    this._routes[i] = newRoute;
  }

  if(this._config.use_auth) {
    RESTstop.initAuth();
  }
};

_RESTstop.prototype._start = function(){
  var self = this;

  if(this._started){
    throw new Error("RESTstop has already been started");
  }

  this._started = true;

  // hook up the serving
  var self = this,
      connect = Npm.require("connect");

  WebApp.connectHandlers.use(connect.query());
  WebApp.connectHandlers.use(connect.bodyParser(this._config.bodyParser));
  WebApp.connectHandlers.use(function(req, res, next) {
    if (req.url.slice(0, self._config.api_path.length) !== self._config.api_path) {
      return next();
    }

    // need to wrap in a fiber in case they do something async
    // (e.g. in the database)
    if(typeof(Fiber)=="undefined") Fiber = Npm.require('fibers');

    Fiber(function() {
      res.statusCode = 200; // 200 response, by default
      var output = RESTstop.match(req, res);

      if (output === false) {
        output = [404, {success: false, message:'API method not found'}];
      }

      // parse out the various type of response we can have

      // array can be
      // [content], [status, content], [status, headers, content]
      if (_.isArray(output)) {
        // copy the array so we aren't actually modifying it!
        output = output.slice(0);

        if (output.length === 3) {
          var headers = output.splice(1, 1)[0];
          _.each(headers, function(value, key) {
            res.setHeader(key, value);
          });
        }

        if (output.length === 2) {
          res.statusCode = output.shift();
        }

        output = output[0];
      }

      if (_.isNumber(output)) {
        res.statusCode = output;
        output = '';
      }

      if(_.isObject(output)) {
        if (self._config.pretty_json) {
          output = JSON.stringify(output, null, "  ");
        } else {
          output = JSON.stringify(output);
        }
        if (res.getHeader("Content-Type")) {
          res.setHeader("Content-Type", "text/json");
        }
      }

      return res.end(output);
    }).run();
  });
};

_RESTstop.prototype.call = function (context, name, args) {
  var args = Array.prototype.slice.call(arguments, 2);
  return this._apply(context, name, args, 'method_handlers');
};

_RESTstop.prototype.apply = function (context, name, args) {
  return this._apply(context, name, args, 'method_handlers');
};

_RESTstop.prototype.getPublished = function (context, name, args) {
  return this._apply(context, name, args, 'publish_handlers');
};

MethodInvocation = function (options) {
  var self = this;

  // true if we're running not the actual method, but a stub (that is,
  // if we're on a client (which may be a browser, or in the future a
  // server connecting to another server) and presently running a
  // simulation of a server-side method for latency compensation
  // purposes). not currently true except in a client such as a browser,
  // since there's usually no point in running stubs unless you have a
  // zero-latency connection to the user.
  this.isSimulation = options.isSimulation;

  // call this function to allow other method invocations (from the
  // same client) to continue running without waiting for this one to
  // complete.
  this._unblock = options.unblock || function () {};
  this._calledUnblock = false;

  // current user id
  this.userId = options.userId;

  // sets current user id in all appropriate server contexts and
  // reruns subscriptions
  this._setUserId = options.setUserId || function () {};

  // used for associating the connection with a login token so that the
  // connection can be closed if the token is no longer valid
  this._setLoginToken = options._setLoginToken || function () {};

  // Scratch data scoped to this connection (livedata_connection on the
  // client, livedata_session on the server). This is only used
  // internally, but we should have real and documented API for this
  // sort of thing someday.
  this._sessionData = options.sessionData;
};

_.extend(MethodInvocation.prototype, {
  unblock: function () {
    var self = this;
    self._calledUnblock = true;
    self._unblock();
  },
  setUserId: function(userId) {
    var self = this;
    if (self._calledUnblock)
      throw new Error("Can't call setUserId in a method after calling unblock");
    self.userId = userId;
    self._setUserId(userId);
  },
  _setLoginToken: function (token) {
    this._setLoginToken(token);
    this._sessionData.loginToken = token;
  },
  _getLoginToken: function (token) {
    return this._sessionData.loginToken;
  }
});

_RESTstop.prototype._apply = function (context, name, args, handler_name) {
  var self = Meteor.default_server;

  // Run the handler
  var handler = self[handler_name][name];
  var exception;
  if (!handler) {
    exception = new Meteor.Error(404, "Method not found");
  } else {

    var userId = context.user ? context.user._id : null;
    var setUserId = function() {
      throw new Error("Can't call setUserId on a server initiated method call");
    };

    var invocation = new MethodInvocation({
      isSimulation: false,
      userId: userId,
      setUserId: setUserId,
      sessionData: self.sessionData
    });

    try {
      var result = DDP._CurrentInvocation.withValue(invocation, function () {
        return maybeAuditArgumentChecks(
          handler, invocation, args, "internal call to '" + name + "'");
      });
    } catch (e) {
      exception = e;
    }
  }

  if (exception)
    throw exception;
  return result;
};

var maybeAuditArgumentChecks = function (f, context, args, description) {
  args = args || [];
  if (Package['audit-argument-checks']) {
    return Match._failIfArgumentsAreNotAllChecked(
      f, context, args, description);
  }
  return f.apply(context, args);
};

// Make the router available
RESTstop = new _RESTstop();
<|endoftext|>


<commit_before>// Karma configuration
// Generated on Tue Jun 03 2014 00:28:29 GMT+0400 (MSK)

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
        frameworks: ['mocha', 'sinon-expect'],

        // list of files / patterns to load in the browser
        files: [
            'test/helpers/setup.js',

            'node_modules/setimmediate2/setImmediate.js',
            'bower_components/vow/vow.min.js',
            'bower_components/es5-shim/es5-shim.js',
            'bower_components/react/react-with-addons.js',

            'src/xtag.js',
            'src/xblocks.js',
            'test/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
        preprocessors: {
            '**/*.js': [ 'borschik' ],
            '**/*.jsx': [ 'react-jsx' ],
            '**/src/*.js': 'coverage'
        },

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: [ 'progress', 'coverage' ],

        coverageReporter: {
            dir : 'coverage',
            type: 'lcov',
            subdir: 'report'
        },

        // 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: [
            'PhantomJS',
            'ChromeCanary',
            'Firefox',
            'FirefoxDeveloperEdition',
            'Safari',
            'Opera',

            //'Firefox5',
            //'Firefox6',
            //'Firefox10',
            //'Firefox11',
            //'Firefox12',
            //'Firefox13',

            'Firefox14',
            'Firefox15',
            'Firefox19',
            'Firefox30',
            'Firefox32'
        ],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: false
    });
};
<commit_msg>coverage settings<commit_after>// Karma configuration
// Generated on Tue Jun 03 2014 00:28:29 GMT+0400 (MSK)

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
        frameworks: ['mocha', 'sinon-expect'],

        // list of files / patterns to load in the browser
        files: [
            'test/helpers/setup.js',

            'node_modules/setimmediate2/setImmediate.js',
            'bower_components/vow/vow.min.js',
            'bower_components/es5-shim/es5-shim.js',
            'bower_components/react/react-with-addons.js',

            'src/xtag.js',
            'src/xblocks.js',
            'test/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
        preprocessors: {
            '**/*.js': [ 'borschik' ],
            '**/*.jsx': [ 'react-jsx' ],
            '**/src/xblocks.js': 'coverage'
        },

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: [ 'progress', 'coverage' ],

        coverageReporter: {
            dir : 'coverage',
            type: 'lcov',
            subdir: 'report'
        },

        // 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: [
            'PhantomJS',
            'ChromeCanary',
            'Firefox',
            'FirefoxDeveloperEdition',
            'Safari',
            'Opera',

            //'Firefox5',
            //'Firefox6',
            //'Firefox10',
            //'Firefox11',
            //'Firefox12',
            //'Firefox13',

            'Firefox14',
            'Firefox15',
            'Firefox19',
            'Firefox30',
            'Firefox32'
        ],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: false
    });
};
<|endoftext|>


<commit_before>'use strict';
var express = require('express');
var keystone = require('keystone');
var csrf = require('csurf');
var co = require('collections-online');

// Loading the configuration
var config = require('./config');
co.config(config);

// Creating an express app
var app = express();

// Set up Keystone
keystone.init(config.keystone.options);

if(config.cloudinaryUrl) {
  // Set up cloudinary
  keystone.set('cloudinary config', config.cloudinaryUrl);
  // Prefix all built-in tags with 'keystone_'
  keystone.set('cloudinary prefix', 'keystone');
  // Prefix each image public_id with [{prefix}]/{list.path}/{field.path}/
  keystone.set('cloudinary folders', true);
  // Force cloudinary to serve images over https
  keystone.set('cloudinary secure', true);
}

// Richer wysiwyg
keystone.set('wysiwyg additional buttons', 'styleselect, blockquote');

keystone.import('./models');

keystone.initExpressApp(app);
co.initialize(app, [
  require('collections-online-cumulus')
]).then(() => {
  // Keystone form validation
  app.use('/keystone', csrf());
  app.use('/keystone', function(req, res, next) {
    res.locals.csrftoken = req.csrfToken();
    return next();
  });

  keystone.set('routes', require('./routes')(app));
  co.registerRoutes(app);

  keystone.set('nav', config.keystone.nav);

  app.use('/keystone', keystone.Admin.Server.createStaticRouter(keystone));

  app.use(keystone.get('session options').cookieParser);
  app.use(keystone.expressSession);
  app.use(keystone.session.persist);
  app.use(require('connect-flash')());

  app.use('/keystone', keystone.Admin.Server.createDynamicRouter(keystone));

  keystone.openDatabaseConnection(function() {
    require('./menus')(app);
  });

  co.registerErrors(app);
}).then(null, console.error);
<commit_msg>No need for the lines setting up the session anymore<commit_after>'use strict';
var express = require('express');
var keystone = require('keystone');
var csrf = require('csurf');
var co = require('collections-online');

// Loading the configuration
var config = require('./config');
co.config(config);

// Creating an express app
var app = express();

// Set up Keystone
keystone.init(config.keystone.options);

if(config.cloudinaryUrl) {
  // Set up cloudinary
  keystone.set('cloudinary config', config.cloudinaryUrl);
  // Prefix all built-in tags with 'keystone_'
  keystone.set('cloudinary prefix', 'keystone');
  // Prefix each image public_id with [{prefix}]/{list.path}/{field.path}/
  keystone.set('cloudinary folders', true);
  // Force cloudinary to serve images over https
  keystone.set('cloudinary secure', true);
}

// Richer wysiwyg
keystone.set('wysiwyg additional buttons', 'styleselect, blockquote');

keystone.import('./models');

keystone.initExpressApp(app);

co.initialize(app, [
  require('collections-online-cumulus')
]).then(() => {
  // Keystone form validation
  app.use('/keystone', csrf());
  app.use('/keystone', function(req, res, next) {
    res.locals.csrftoken = req.csrfToken();
    return next();
  });

  keystone.set('routes', require('./routes')(app));
  co.registerRoutes(app);

  keystone.set('nav', config.keystone.nav);

  app.use('/keystone', keystone.Admin.Server.createStaticRouter(keystone));
  app.use('/keystone', keystone.Admin.Server.createDynamicRouter(keystone));

  keystone.openDatabaseConnection(function() {
    require('./menus')(app);
  });

  co.registerErrors(app);
}).then(null, console.error);
<|endoftext|>


<commit_before>var path = require('path');

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

var ENV = process.env.npm_lifecycle_event;
var isTestWatch = ENV === 'test-watch';

module.exports = function (config) {
  var _config = {

    // 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
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
      { pattern: './karma-shim.js', watched: false },
      { pattern: '**/*.js.map', included: false }
    ],

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

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
      './karma-shim.js': ['webpack', 'sourcemap'],
      '**/*.js': ['sourcemap']
    },

    webpack: webpackConfig,

    webpackMiddleware: {
      // webpack-dev-middleware configuration
      // i. e.
      stats: 'errors-only'
    },

    webpackServer: {
      noInfo: true // please don't spam the console when running in karma!
    },

    // test results reporter to use
    // possible values: 'dots', 'progress', 'mocha'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ["mocha"],

    // 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: false,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: isTestWatch ? ['Chrome'] : ['PhantomJS'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true,

    plugins: [
      'karma-jasmine',
      'karma-webpack',
      'karma-chrome-launcher',
      'karma-phantomjs-launcher',
      'karma-sourcemap-loader',
      'karma-mocha',
      'karma-mocha-reporter',
      'karma-coverage'
    ],
  };

  if (!isTestWatch) {
    _config.reporters.push("coverage");

    _config.coverageReporter = {
      dir: 'coverage/',
      reporters: [{
        type: 'html',
        dir: 'coverage',
        subdir: '.',
        file: 'coverage.html'
      }]
    };
  }

  config.set(_config);

};
<commit_msg>Changed testing browser<commit_after>var path = require('path');

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

var ENV = process.env.npm_lifecycle_event;
var isTestWatch = ENV === 'test-watch';

module.exports = function (config) {
  var _config = {

    // 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
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
      { pattern: './karma-shim.js', watched: false },
      { pattern: '**/*.js.map', included: false }
    ],

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

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
      './karma-shim.js': ['webpack', 'sourcemap'],
      '**/*.js': ['sourcemap']
    },

    webpack: webpackConfig,

    webpackMiddleware: {
      // webpack-dev-middleware configuration
      // i. e.
      stats: 'errors-only'
    },

    webpackServer: {
      noInfo: true // please don't spam the console when running in karma!
    },

    // test results reporter to use
    // possible values: 'dots', 'progress', 'mocha'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ["mocha"],

    // 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: false,

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: isTestWatch ? ['Chrome'] : ['Chrome'],

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true,

    plugins: [
      'karma-jasmine',
      'karma-webpack',
      'karma-chrome-launcher',
      'karma-phantomjs-launcher',
      'karma-sourcemap-loader',
      'karma-mocha',
      'karma-mocha-reporter',
      'karma-coverage'
    ],
  };

  if (!isTestWatch) {
    _config.reporters.push("coverage");

    _config.coverageReporter = {
      dir: 'coverage/',
      reporters: [{
        type: 'html',
        dir: 'coverage',
        subdir: '.',
        file: 'coverage.html'
      }]
    };
  }

  config.set(_config);

};
<|endoftext|>


<commit_before>// Karma configuration

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

// list of files / patterns to load in the browser
files = [
  JASMINE,
  JASMINE_ADAPTER,
  'bower_components/jquery/jquery.js',
  'bower_components/angular/angular.js',
  'bower_components/angular-mocks/angular-mocks.js',
  '*.coffee',
  'test/*.coffee'
];

// list of files to exclude
exclude = [];

// test results reporter to use
// possible values: dots || progress || growl
reporters = ['progress'];

// web server port
port = 8080;

// cli runner port
runnerPort = 9100;

// enable / disable colors in the output (reporters and logs)
colors = true;

// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel = 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 = ['Chrome'];

// 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;
<commit_msg>Updated karma.conf<commit_after>// Karma configuration
module.exports = function(config) {
	config.set({

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

		frameworks: ['jasmine'],

		// list of files / patterns to load in the browser
		files: [
			'bower_components/jquery/jquery.js',
			'bower_components/angular/angular.js',
			'bower_components/angular-mocks/angular-mocks.js',
			'*.coffee',
			'test/*.coffee'
		],

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

		// test results reporter to use
		// possible values: dots || progress || growl
		reporters: ['progress'],

		// web server port
		port: 8080,

		// cli runner port
		runnerPort: 9100,

		// enable / disable colors in the output (reporters and logs)
		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: ['Chrome'],

		// 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

	});
}
<|endoftext|>


<commit_before>// Karma configuration
// Generated on Thu Oct 27 2016 14:25:22 GMT+0530 (India Standard Time)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '../gafGIT/',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha','chai'],

    // list of files / patterns to load in the browser
    files: [
      'src/test/*.spec.js'
    ],

    // list of files to exclude
    exclude: [
    'bower_components/jquery/src/ajax.js'
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },

    // 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'],

    // 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
  })
}
<commit_msg>Updated base path<commit_after>// Karma configuration
// Generated on Thu Oct 27 2016 14:25:22 GMT+0530 (India Standard Time)

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
    frameworks: ['mocha','chai'],

    // list of files / patterns to load in the browser
    files: [
      'src/test/*.spec.js'
    ],

    // list of files to exclude
    exclude: [
    'bower_components/jquery/src/ajax.js'
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },

    // 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'],

    // 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
  })
}
<|endoftext|>


<commit_before>// Karma configuration
// Generated on Fri Aug 01 2014 09:51:05 GMT+0200 (CEST)

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
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            // bower:js
            'bower_components/angular/angular.js',
            'bower_components/angular-messages/angular-messages.js',
            'bower_components/angular-animate/angular-animate.js',
            'bower_components/angular-mocks/angular-mocks.js',
            // endbower

            // modules first
            'src/**/_*.js',
            // all the rest of the files
            'src/**/*.js'
        ],

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

        preprocessors: {
            // source files, that you wanna generate coverage for
            // do not include tests or libraries
            // (these files will be instrumented by Istanbul)
            '**/src/**/!(*.spec)+(.js)': ['coverage']
        },

        // 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: ['PhantomJS'],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: false
    });
};
<commit_msg>adding firefox for unit tests #62<commit_after>// Karma configuration
// Generated on Fri Aug 01 2014 09:51:05 GMT+0200 (CEST)

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
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            // bower:js
            'bower_components/angular/angular.js',
            'bower_components/angular-messages/angular-messages.js',
            'bower_components/angular-animate/angular-animate.js',
            'bower_components/angular-mocks/angular-mocks.js',
            // endbower

            // modules first
            'src/**/_*.js',
            // all the rest of the files
            'src/**/*.js'
        ],

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

        preprocessors: {
            // source files, that you wanna generate coverage for
            // do not include tests or libraries
            // (these files will be instrumented by Istanbul)
            '**/src/**/!(*.spec)+(.js)': ['coverage']
        },

        // 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: ['PhantomJS', 'Firefox'],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: false
    });
};
<|endoftext|>


<commit_before>/**
 * Copyright 2016 Chialab. All Rights Reserved.
 *
 * The MIT License (MIT)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

var json = require('./package.json');

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
        frameworks: ['mocha', 'chai'],

        // list of files / patterns to load in the browser
        files: [
            'packages/**/*.spec.js',
        ],

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

        rollupPreprocessor: Object.assign({
            sourceMap: false,
            format: 'iife',
        }, require('./rollup.config.js')),

        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {
            'packages/**/*.js': ['rollup'],
        },

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: [
            process.env.CI ? 'dots' : 'progress',
            'coverage',
        ],

        // 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'],

        // 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,
    });

    if (process.env.CI) {
        config.set({
            client: {
                captureConsole: false,
            },
            logLevel: config.LOG_ERROR,
        });

        switch (process.env.CI_BUILD_TYPE) {
            case 'saucelabs':
                var saucelabsBrowsers = require('./sl.browsers.js');
                config.set({
                    browserDisconnectTimeout: 10000,
                    browserDisconnectTolerance: 1,
                    browserNoActivityTimeout: 4 * 60 * 1000,
                    captureTimeout: 4 * 60 * 1000,
                    reporters: ['dots', 'saucelabs'],
                    sauceLabs: {
                        startConnect: false,
                        options: {},
                        username: process.env.SAUCE_USERNAME,
                        accessKey: process.env.SAUCE_ACCESS_KEY,
                        build: process.env.TRAVIS ?
                            `TRAVIS # ${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})` :
                            undefined,
                        tunnelIdentifier: process.env.TRAVIS ?
                            process.env.TRAVIS_JOB_NUMBER :
                            undefined,
                        recordScreenshots: true,
                    },
                    customLaunchers: saucelabsBrowsers,
                    browsers: Object.keys(saucelabsBrowsers),
                });
                break;
            default:
                config.set({
                    coverageReporter: {
                        dir: 'coverage',
                        reporters: [
                            { type: 'lcov', subdir: 'report-lcov' },
                        ],
                    },
                    customLaunchers: {
                        Chrome_CI: {
                            base: 'Chrome',
                            flags: ['--no-sandbox'],
                        },
                    },
                    browsers: ['Chrome_CI', 'Firefox'],
                });
                break;
        }
    } else {
        config.set({
            coverageReporter: {
                dir: 'coverage',
                reporters: [
                    { type: 'html', subdir: 'report-html' },
                ],
            },
        });
    }
};
<commit_msg>test: create multiple coverage reports<commit_after>/**
 * Copyright 2016 Chialab. All Rights Reserved.
 *
 * The MIT License (MIT)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

var path = require('path');
var json = require('./package.json');

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
        frameworks: ['mocha', 'chai'],

        // list of files / patterns to load in the browser
        files: [
            'packages/**/*.spec.js',
        ],

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

        rollupPreprocessor: Object.assign({
            sourceMap: false,
            format: 'iife',
        }, require('./rollup.config.js')),

        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {
            'packages/**/*.js': ['rollup'],
        },

        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: [
            process.env.CI ? 'dots' : 'progress',
            'coverage',
        ],

        // 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,
    });

    if (process.env.CI) {
        config.set({
            client: {
                captureConsole: false,
            },
            logLevel: config.LOG_ERROR,
        });

        switch (process.env.CI_BUILD_TYPE) {
            case 'saucelabs':
                var saucelabsBrowsers = require('./sl.browsers.js');
                config.set({
                    browserDisconnectTimeout: 10000,
                    browserDisconnectTolerance: 1,
                    browserNoActivityTimeout: 4 * 60 * 1000,
                    captureTimeout: 4 * 60 * 1000,
                    reporters: ['dots', 'saucelabs'],
                    sauceLabs: {
                        startConnect: false,
                        options: {},
                        username: process.env.SAUCE_USERNAME,
                        accessKey: process.env.SAUCE_ACCESS_KEY,
                        build: process.env.TRAVIS ?
                            `TRAVIS # ${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})` :
                            undefined,
                        tunnelIdentifier: process.env.TRAVIS ?
                            process.env.TRAVIS_JOB_NUMBER :
                            undefined,
                        recordScreenshots: true,
                    },
                    customLaunchers: saucelabsBrowsers,
                    browsers: Object.keys(saucelabsBrowsers),
                });
                break;
            default:
                config.set({
                    coverageReporter: {
                        dir: 'coverage',
                        reporters: [
                            {
                                type: 'lcov',
                                subdir: function(browserName) {
                                    return path.join('report-lcov', browserName);
                                },
                            },
                        ],
                    },
                    customLaunchers: {
                        Chrome_CI: {
                            base: 'Chrome',
                            flags: ['--no-sandbox'],
                        },
                    },
                    browsers: ['Chrome_CI', 'Firefox'],
                });
                break;
        }
    } else {
        config.set({
            coverageReporter: {
                dir: 'coverage',
                reporters: [
                    {
                        type: 'html',
                        subdir: function(browserName) {
                            return path.join('report-html', browserName);
                        },
                    },
                    {
                        type: 'lcov',
                        subdir: function(browserName) {
                            return path.join('report-lcov', browserName);
                        },
                    },
                ],
            },
        });
    }
};
<|endoftext|>


<commit_before>var webpack = require('webpack');

module.exports = function (config) {
  config.set({

    browsers: [ process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome' ],

    singleRun: process.env.CONTINUOUS_INTEGRATION === 'true',

    frameworks: [ 'mocha' ],

    files: [
      'tests.webpack.js'
    ],

    preprocessors: {
      'tests.webpack.js': [ 'webpack', 'sourcemap' ]
    },

    webpack: {
      devtool: 'inline-source-map',
      module: {
        loaders: [
          { test: /\.js$/, loader: 'jsx-loader?harmony' }
        ]
      },
      plugins: [
        new webpack.DefinePlugin({
          'process.env.NODE_ENV': JSON.stringify('test')
        })
      ]
    },

    webpackServer: {
      noInfo: true
    }

  });
};
<commit_msg>Use "dots" karma reporter (for Travis CI web UI)<commit_after>var webpack = require('webpack');

module.exports = function (config) {
  config.set({

    browsers: [ process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome' ],

    singleRun: process.env.CONTINUOUS_INTEGRATION === 'true',

    frameworks: [ 'mocha' ],

    files: [
      'tests.webpack.js'
    ],

    preprocessors: {
      'tests.webpack.js': [ 'webpack', 'sourcemap' ]
    },

    reporters: [ 'dots' ],

    webpack: {
      devtool: 'inline-source-map',
      module: {
        loaders: [
          { test: /\.js$/, loader: 'jsx-loader?harmony' }
        ]
      },
      plugins: [
        new webpack.DefinePlugin({
          'process.env.NODE_ENV': JSON.stringify('test')
        })
      ]
    },

    webpackServer: {
      noInfo: true
    }

  });
};
<|endoftext|>


<commit_before>const webpack = require("./webpack.config");
const path = require("path");

const reporters = ["mocha", "coverage"];
if (process.env.TRAVIS) {
  reporters.push("coveralls");
}

module.exports = function(config) {
  config.set({
    singleRun: true,
    browsers: ["Firefox"],
    frameworks: ["mocha", "sinon", "chai"],
    reporters,
    coverageReporter: {
      dir: "logs/reports/coverage",
      reporters: [
        {
          type: "lcov",
          subdir: "lcov"
        },
        {
          type: "html",
          subdir: "html"
        },
        {
          type: "text",
          subdir: ".",
          file: "text.txt"
        },
        {
          type: "text-summary",
          subdir: ".",
          file: "text-summary.txt"
        }
      ]
    },
    files: [
      "content-test/index.js",
      {pattern: "data/content/favicons/**/*", watched: false, included: false, served: true}
    ],
    proxies: {"/favicons/": "/base/data/content/favicons/"},
    preprocessors: {"content-test/**/*.js": ["webpack", "sourcemap"]},
    webpack: {
      devtool: "inline-source-map",
      resolve: {
        extensions: webpack.resolve.extensions,
        alias: Object.assign({}, webpack.resolve.alias, {
          "shims": path.join(__dirname, "shims"),
          // This is necessary in order to be able to import
          // files from the addon side.
          "chrome": "shims/chrome.js",
          "sdk": "shims/sdk"
        })
      },
      resolveLoader: {alias: {inject: path.join(__dirname, "loaders/inject-loader")}},
      module: {
        loaders: webpack.module.loaders,
        postLoaders: [{
          test: /\.js$/,
          loader: "istanbul-instrumenter",
          include: [
            path.join(__dirname, "content-src"),
            path.join(__dirname, "addon/PerfMeter.js")
          ],
          exclude: [/DebugPage/, /\.test\.js$/]
        }]
      },
      plugins: webpack.plugins
    },
    webpackMiddleware: {noInfo: true}
  });
};
<commit_msg>chore(coverage): Add common, addon to coverage reporting (#1787)<commit_after>const webpack = require("./webpack.config");
const path = require("path");

const reporters = ["mocha", "coverage"];
if (process.env.TRAVIS) {
  reporters.push("coveralls");
}

module.exports = function(config) {
  config.set({
    singleRun: true,
    browsers: ["Firefox"],
    frameworks: ["mocha", "sinon", "chai"],
    reporters,
    coverageReporter: {
      dir: "logs/reports/coverage",
      reporters: [
        {
          type: "lcov",
          subdir: "lcov"
        },
        {
          type: "html",
          subdir: "html"
        },
        {
          type: "text",
          subdir: ".",
          file: "text.txt"
        },
        {
          type: "text-summary",
          subdir: ".",
          file: "text-summary.txt"
        }
      ]
    },
    files: [
      "content-test/index.js",
      {pattern: "data/content/favicons/**/*", watched: false, included: false, served: true}
    ],
    proxies: {"/favicons/": "/base/data/content/favicons/"},
    preprocessors: {"content-test/**/*.js": ["webpack", "sourcemap"]},
    webpack: {
      devtool: "inline-source-map",
      resolve: {
        extensions: webpack.resolve.extensions,
        alias: Object.assign({}, webpack.resolve.alias, {
          "shims": path.join(__dirname, "shims"),
          // This is necessary in order to be able to import
          // files from the addon side.
          "chrome": "shims/chrome.js",
          "sdk": "shims/sdk"
        })
      },
      resolveLoader: {alias: {inject: path.join(__dirname, "loaders/inject-loader")}},
      module: {
        loaders: webpack.module.loaders,
        postLoaders: [{
          test: /\.js$/,
          loader: "istanbul-instrumenter",
          include: [
            path.join(__dirname, "content-src"),
            path.join(__dirname, "common"),
            path.join(__dirname, "addon")
          ],
          exclude: [
            /DebugPage/,
            /\.test\.js$/,
            path.join(__dirname, "addon/ActivityStreams.js"),
            path.join(__dirname, "addon/AppURLHider.js"),
            path.join(__dirname, "addon/ColorAnalyzer.js"),
            path.join(__dirname, "addon/ColorAnalyzerProvider.js"),
            path.join(__dirname, "addon/main.js"),
            path.join(__dirname, "addon/MetadataStore.js"),
            path.join(__dirname, "addon/MetadataStoreMigration.js"),
            path.join(__dirname, "addon/PlacesProvider.js"),
            path.join(__dirname, "addon/PreviewProvider.js"),
            path.join(__dirname, "addon/RecommendationProvider.js"),
            path.join(__dirname, "addon/SearchProvider.js"),
            path.join(__dirname, "addon/ShareManifests.js"),
            path.join(__dirname, "addon/ShareProvider.js"),
            path.join(__dirname, "addon/TabTracker.js"),
            path.join(__dirname, "addon/TelemetrySender.js"),
            path.join(__dirname, "addon/TippyTopProvider.js")
          ]
        }]
      },
      plugins: webpack.plugins
    },
    webpackMiddleware: {noInfo: true}
  });
};
<|endoftext|>


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

    config.set({
        basePath: '',
        client: {
            mocha: {
                timeout: 8000
            }
        },
        frameworks: ['mocha', 'browserify', 'chai', 'sinon'],
        preprocessors: {
            'js/tests/**/*.spec.js': ['browserify']
        },
        browserify: {
            transform: [require('hbsfy'), require('rehab-fe-skeleton-testsuite/node_modules/browserify-istanbul')],
            watch: false
        },
        files: [
            'js/tests/**/*.spec.js'
        ],
        exclude: [],
        junitReporter: {
            outputFile: 'fe-test-results.xml'
        },
        coverageReporter: {
            dir: './',
            reporters: [
                { type: 'cobertura', subdir: '.', file: 'fe-coverage-results.xml' },
                { type: 'text' }
            ]
        },
        reporters: ['progress', 'junit', 'coverage'],
        port: 9876,
        colors: true,
        autoWatch: false,
        browsers: ['PhantomJS'],
        singleRun: true,
        logLevel: config.LOG_INFO
    });
};<commit_msg>Removing JUnit settings and adding coverage options.<commit_after>module.exports = function(config) {
    'use strict';

    config.set({
        basePath: '',
        client: {
            mocha: {
                timeout: 8000
            }
        },
        frameworks: ['mocha', 'browserify', 'chai', 'sinon'],
        preprocessors: {
            'js/tests/**/*.spec.js': ['browserify']
        },
        browserify: {
            transform: [
                require('hbsfy'),
                [
                    require('rehab-fe-skeleton-testsuite/node_modules/browserify-istanbul'),
                    {
                        ignore: ['**/node_modules/**', '**/bower_components/**', '**/*.spec.js'],
                        defaultIgnore: false
                    }
                ]
            ],
            watch: false
        },
        files: [
            'js/tests/**/*.spec.js'
        ],
        exclude: [],
        coverageReporter: {
            dir: './',
            reporters: [
                { type: 'cobertura', subdir: '.', file: 'fe-coverage-results.xml' },
                { type: 'text' }
            ]
        },
        reporters: ['progress', 'coverage'],
        port: 9876,
        colors: true,
        autoWatch: false,
        browsers: ['PhantomJS'],
        singleRun: true,
        logLevel: config.LOG_INFO
    });
};<|endoftext|>


<commit_before>// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html

module.exports = function(config) {
  config.set({
    // base path, that will be used to resolve files and exclude
    basePath: './',

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

    // list of files / patterns to load in the browser
    files: [
      'client/bower_components/jquery/dist/jquery.js',
      'client/bower_components/angular-payments/stripe.js',
      'client/bower_components/angular/angular.js',
      'client/bower_components/angular-mocks/angular-mocks.js',
      'client/bower_components/angular-resource/angular-resource.js',
      'client/bower_components/angular-cookies/angular-cookies.js',
      'client/bower_components/angular-messages/angular-messages.js',
      'client/bower_components/angular-material/angular-material.js',
      'client/bower_components/angular-aria/angular-aria.js',
      'client/bower_components/angular-material-data-table/dist/md-data-table.js',
      'client/bower_components/angular-minicolors/angular-minicolors.js',
      'client/bower_components/angular-sanitize/angular-sanitize.js',
      'client/bower_components/angular-animate/angular-animate.js',
      'client/bower_components/angular-route/angular-route.js',
      'client/bower_components/angular-gettext/dist/angular-gettext.js',
      'client/bower_components/angular-payments/lib/angular-payments.js',
      'client/bower_components/pusher-angular/pusher.min.js',
      'client/bower_components/pusher-angular/lib/pusher-angular.js',
      'client/bower_components/ngstorage/ngStorage.js',
      'client/bower_components/angular-scroll-glue/src/scrollglue.js',
      'client/bower_components/foundation/css/foundation.css',
      'client/bower_components/angular-foundation/template/**/*.html',
      'client/bower_components/ngStorage/ngStorage.js',
      'client/bower_components/jquery-minicolors/jquery.minicolors.js',
      'client/bower_components/angular-touch/angular-touch.js',
      'client/bower_components/filepicker-ct/filepicker.min.js',
      'client/bower_components/select2/select2.js',
      'client/bower_components/nouislider/jquery.nouislider.min.js',
      'client/bower_components/moment/moment.js',
      'client/bower_components/urijs/src/URI.js',
      'client/bower_components/moment-timezone/moment-timezone.js',
      'client/bower_components/angular-moment/angular-moment.min.js',
      'client/scripts/config.js',
      'client/app/app.js',
      'client/app/**/*.js',
      'client/components/**/*.js',
      'client/app/**/*.html',
      'client/components/**/*.html',
      'test/spec/**/*.js',
      'test/ec2/**/*.js',
      'client/bower_components/emojionearea/src/emojionearea.js',
    ],

    preprocessors: {
      'client/components/**/*.html': ['ng-html2js'],
    },

    ngHtml2JsPreprocessor: {
      stripPrefix: 'client/',
      moduleName: "templates"
    },

    cacheIdFromPath: function(filepath) {
      return filepath.match(/client\/components\/*\*\/.*/)[0];
    },

    exclude: [],

    port: 9090,

    logLevel: config.LOG_INFO,

    autoWatch: false,

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera
    // - Safari (only Mac)
    // - PhantomJS
    // - IE (only Windows)
    browsers: ['PhantomJS2'],
    // Continuous Integration mode
    // if true, it capture browsers, run tests and exit
    singleRun: true
  });
};
<commit_msg>karma<commit_after>// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html

module.exports = function(config) {
  config.set({
    // base path, that will be used to resolve files and exclude
    basePath: './',

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

    // list of files / patterns to load in the browser
    files: [
      'client/bower_components/jquery/dist/jquery.js',
      'client/bower_components/angular-payments/stripe.js',
      'client/bower_components/angular/angular.js',
      'client/bower_components/angular-mocks/angular-mocks.js',
      'client/bower_components/angular-resource/angular-resource.js',
      'client/bower_components/angular-cookies/angular-cookies.js',
      'client/bower_components/angular-messages/angular-messages.js',
      'client/bower_components/angular-material/angular-material.js',
      'client/bower_components/angular-aria/angular-aria.js',
      'client/bower_components/angular-material-data-table/dist/md-data-table.js',
      'client/bower_components/angular-minicolors/angular-minicolors.js',
      'client/bower_components/angular-sanitize/angular-sanitize.js',
      'client/bower_components/angular-animate/angular-animate.js',
      'client/bower_components/angular-route/angular-route.js',
      'client/bower_components/angular-gettext/dist/angular-gettext.js',
      'client/bower_components/angular-payments/lib/angular-payments.js',
      'client/bower_components/pusher-angular/pusher.min.js',
      'client/bower_components/pusher-angular/lib/pusher-angular.js',
      'client/bower_components/ngstorage/ngStorage.js',
      'client/bower_components/angular-scroll-glue/src/scrollglue.js',
      'client/bower_components/foundation/css/foundation.css',
      'client/bower_components/angular-foundation/template/**/*.html',
      'client/bower_components/ngStorage/ngStorage.js',
      'client/bower_components/jquery-minicolors/jquery.minicolors.js',
      'client/bower_components/angular-touch/angular-touch.js',
      'client/bower_components/filepicker-ct/filepicker.min.js',
      'client/bower_components/select2/select2.js',
      'client/bower_components/nouislider/jquery.nouislider.min.js',
      'client/bower_components/moment/moment.js',
      'client/bower_components/urijs/src/URI.js',
      'client/bower_components/moment-timezone/moment-timezone.js',
      'client/bower_components/angular-moment/angular-moment.min.js',
      'client/bower_components/emojionearea/dist/emojionearea.min.js',
      'client/scripts/config.js',
      'client/app/app.js',
      'client/app/**/*.js',
      'client/components/**/*.js',
      'client/app/**/*.html',
      'client/components/**/*.html',
      'test/spec/**/*.js',
      'test/ec2/**/*.js',
    ],

    preprocessors: {
      'client/components/**/*.html': ['ng-html2js'],
    },

    ngHtml2JsPreprocessor: {
      stripPrefix: 'client/',
      moduleName: "templates"
    },

    cacheIdFromPath: function(filepath) {
      return filepath.match(/client\/components\/*\*\/.*/)[0];
    },

    exclude: [],

    port: 9090,

    logLevel: config.LOG_INFO,

    autoWatch: false,

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera
    // - Safari (only Mac)
    // - PhantomJS
    // - IE (only Windows)
    browsers: ['PhantomJS2'],
    // Continuous Integration mode
    // if true, it capture browsers, run tests and exit
    singleRun: true
  });
};
<|endoftext|>


<commit_before>var webpack = require('webpack');
var path = require('path');

module.exports = function (config) {
  config.set({

    browsers: [ 'Chrome' ],

    singleRun: true,

    frameworks: [ 'mocha' ],

    files: [
      './resources/assets/tests/index.js'
    ],

    preprocessors: {
      './resources/assets/tests/index.js': [ 'webpack', 'sourcemap' ]
    },

    reporters: [ 'mocha' ],

    webpack: { //kind of a copy of your webpack config
        devtool: 'inline-source-map', //just do inline source maps instead of the default
        module: {
            preLoaders: [
              {
                  test: /\.js$/,
                  exclude: [
                      // path.resolve('src/components/'),
                      path.resolve('node_modules/')
                  ],
                  loader: 'babel',
                  query: {
                      // https://github.com/babel/babel-loader#options
                      cacheDirectory: true
                  }
              },
              //// instrument only testing sources with Istanbul
              // {
              //     test: /\.js$/,
              //     include: path.resolve('resources/assets/src'),
              //     loader: 'istanbul-instrumenter',
              //     query: {
              //         esModules: true
              //     }
              // }
                // { test: /\.js$/, exclude: [/node_modules/], loader: 'babel-loader' },
                // { test: /\.js$/, exclude: [/test/, /node_modules/], loader: 'isparta'},
                // { test: /\.less$/, include: [/src\/main\/less/], exclude: [/node_modules/, /dist/], loader: "style!css!less" },
            ]
        }
    },
    // reporters: [ 'progress', 'coverage' ],
    // coverageReporter: {
    //     type: 'text'
    // },

  });
};
<commit_msg>karma.config: clean up a bit<commit_after>var webpack = require('webpack');
var path = require('path');

module.exports = function (config) {
  config.set({

    browsers: [ 'Chrome' ],

    singleRun: true,

    frameworks: [ 'mocha' ],

    files: [
      './resources/assets/tests/index.js'
    ],

    preprocessors: {
      './resources/assets/tests/index.js': [ 'webpack', 'sourcemap' ]
    },

    reporters: [ 'mocha' ],

    webpackServer: {
      noInfo: true // Suppress all webpack messages, except errors
    },

    webpack: { //kind of a copy of your webpack config
        devtool: 'inline-source-map', //just do inline source maps instead of the default
        module: {
            preLoaders: [
              {
                  test: /\.js$/,
                  exclude: [
                      // path.resolve('src/components/'),
                      path.resolve('node_modules/')
                  ],
                  loader: 'babel',
                  query: {
                      // https://github.com/babel/babel-loader#options
                      cacheDirectory: true
                  }
              },
              //// instrument only testing sources with Istanbul
              // {
              //     test: /\.js$/,
              //     include: path.resolve('resources/assets/src'),
              //     loader: 'istanbul-instrumenter',
              //     query: {
              //         esModules: true
              //     }
              // }
                // { test: /\.js$/, exclude: [/node_modules/], loader: 'babel-loader' },
                // { test: /\.js$/, exclude: [/test/, /node_modules/], loader: 'isparta'},
                // { test: /\.less$/, include: [/src\/main\/less/], exclude: [/node_modules/, /dist/], loader: "style!css!less" },
            ]
        }
    },
    // reporters: [ 'progress', 'coverage' ],
    // coverageReporter: {
    //     type: 'text'
    // },

  });
};
<|endoftext|>


<commit_before>module.exports = function(config) {
    config.set({
        basePath: '',
        frameworks: ['jasmine'],
        files: [
            'public/lib/angular/angular.min.js',
            'public/lib/angular-route/angular-route.min.js',
            'public/lib/angular-animate/angular-animate.min.js',
            'public/lib/angular-mocks/angular-mocks.js',
            'app/**/*.js',
            'test/unit/**/*Spec.js'
        ],
        exclude: [],
        preprocessors: {
            'app/**/*.js': ['coverage']
        },
        reporters: ['progress', 'coverage'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: true,
        browsers: ['PhantomJS'],
        singleRun: true,
        concurrency: Infinity,
        coverageReporter: {
            dir : 'coverage/',
            check: {
                global: {
                    statements: 25,
                    branches: 0,
                    functions: 100,
                    lines: 0,
                    excludes: []
                }
            },
            reporters: [{
                type: 'html',
                subdir: 'html'
            }, {
                type: 'text',
                subdir: '.',
                file: 'full-report.txt'
            }, {
                type: 'text-summary',
                subdir: '.',
                file: 'summary.txt'
            }, {
                type: 'text-summary'
            }]
        }
    });
};
<commit_msg>Revert failing test scenario<commit_after>module.exports = function(config) {
    config.set({
        basePath: '',
        frameworks: ['jasmine'],
        files: [
            'public/lib/angular/angular.min.js',
            'public/lib/angular-route/angular-route.min.js',
            'public/lib/angular-animate/angular-animate.min.js',
            'public/lib/angular-mocks/angular-mocks.js',
            'app/**/*.js',
            'test/unit/**/*Spec.js'
        ],
        exclude: [],
        preprocessors: {
            'app/**/*.js': ['coverage']
        },
        reporters: ['progress', 'coverage'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: true,
        browsers: ['PhantomJS'],
        singleRun: true,
        concurrency: Infinity,
        coverageReporter: {
            dir : 'coverage/',
            check: {
                global: {
                    statements: 25,
                    branches: 0,
                    functions: 0,
                    lines: 0,
                    excludes: []
                }
            },
            reporters: [{
                type: 'html',
                subdir: 'html'
            }, {
                type: 'text',
                subdir: '.',
                file: 'full-report.txt'
            }, {
                type: 'text-summary',
                subdir: '.',
                file: 'summary.txt'
            }, {
                type: 'text-summary'
            }]
        }
    });
};
<|endoftext|>


<commit_before>module.exports = function(config){
  config.set({

    basePath : './',

    files : [
      'app/bower_components/angular/angular.js',
      'app/bower_components/angular-route/angular-route.js',
      'app/bower_components/angular-mocks/angular-mocks.js',
      'app/components/**/*.js',
      'app/view*/**/*.js'
    ],

    autoWatch : true,

    frameworks: ['jasmine'],

    browsers : ['Chrome'],

    plugins : [
            'karma-chrome-launcher',
            'karma-firefox-launcher',
            'karma-jasmine',
            'karma-junit-reporter'
            ],

    junitReporter : {
      outputFile: 'test_out/unit.xml',
      suite: 'unit'
    }

  });
};
<commit_msg>Updated karma conf<commit_after>module.exports = function(config){
  config.set({

    basePath : './',

    files : [
      'app/bower_components/angular/angular.js',
      'app/bower_components/angular-route/angular-route.js',
      'app/bower_components/angular-mocks/angular-mocks.js',
      'app/components/**/*.js',
      'app/view*/**/*.js'
    ],

    singleRun: true,

    autoWatch : true,

    frameworks: ['jasmine'],

    browsers : ['Chrome'],

    plugins : [
            'karma-chrome-launcher',
            'karma-firefox-launcher',
            'karma-jasmine',
            'karma-junit-reporter'
            ],

    junitReporter : {
      outputFile: 'test_out/unit.xml',
      suite: 'unit'
    }

  });
};
<|endoftext|>


<commit_before>module.exports = function(config) {
    config.set({
        basePath: '',
        frameworks: ['mocha', 'chai'],
        files: [{ pattern: 'spec.bundle.js', watched: false }],
        exclude: [],
        plugins: [
            require('karma-chai'),
            require('karma-chrome-launcher'),
            require('karma-mocha'),
            require('karma-mocha-reporter'),
            require('karma-sourcemap-loader'),
            require('karma-webpack')
        ],
        preprocessors: { 'spec.bundle.js': ['webpack', 'sourcemap'] },
        webpack: {
            devtool: 'inline-source-map',
            module: {
                loaders: [
                    { test: /\.js/, exclude: [/app\/lib/, /node_modules/], loader: 'babel' },
                    { test: /\.html/, loader: 'raw' },
                    { test: /\.scss$/, loader: 'style!css!sass' },
                    { test: /\.css$/, loader: 'style!css' }
                ]
            }
        },
        webpackServer: {
            noInfo: true // prevent console spamming when running in Karma!
        },
        reporters: ['mocha'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: false,
        browsers: ['Chrome'],
        singleRun: true
    });
};
<commit_msg>chore(fix karma tests for webpack2): fixed the karma tests for webpack2<commit_after>module.exports = function(config) {
    config.set({
        basePath: '',
        frameworks: ['mocha', 'chai'],
        files: [{ pattern: 'spec.bundle.js', watched: false }],
        exclude: [],
        plugins: [
            require('karma-chai'),
            require('karma-chrome-launcher'),
            require('karma-mocha'),
            require('karma-mocha-reporter'),
            require('karma-sourcemap-loader'),
            require('karma-webpack')
        ],
        preprocessors: { 'spec.bundle.js': ['webpack', 'sourcemap'] },
        webpack: {
            devtool: 'inline-source-map',
            module: {
                rules: [
                    { test: /\.js/, exclude: [/app\/lib/, /node_modules/], loader: 'babel-loader' },
                    { test: /\.html/, loader: 'raw-loader' },
                    { test: /\.scss$/, loader: 'style-loader!css-loader!sass-loader' },
                    { test: /\.css$/, loader: 'style-loader!css-loader' }
                ]
            }
        },
        webpackServer: {
            noInfo: true // prevent console spamming when running in Karma!
        },
        reporters: ['mocha'],
        port: 9876,
        colors: true,
        logLevel: config.LOG_INFO,
        autoWatch: false,
        browsers: ['Chrome'],
        singleRun: true
    });
};
<|endoftext|>


<commit_before>// Karma configuration
// Generated on Fri Oct 16 2015 18:47:24 GMT-0300 (E. South America Standard Time)

module.exports = function(config) {
	var configuration = {
		// 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
		frameworks: ['jasmine'],

		// list of files / patterns to load in the browser
		files: [
			'src/scripts/*.js',
			'spec/my-test.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
		preprocessors: {
			'scripts/*.js' : ['coverage']
		},

		// configure the reporter
		coverageReporter: {
			type : 'html',
			dir : 'coverage/'
		},

		// test results reporter to use
		// possible values: 'dots', 'progress'
		// available reporters: https://npmjs.org/browse/keyword/karma-reporter
		reporters: ['progress', 'coverage'],

		// 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'],

		customLaunchers: {
			Chrome_travis_ci: {
					base: 'Chrome',
					flags: ['--no-sandbox']
			}
		},

		// Continuous Integration mode
		// if true, Karma captures browsers, runs the tests and exits
		singleRun: false

	};

	if(process.env.TRAVIS){
		configuration.browsers = ['Chrome_travis_ci'],
		configuration.coverageReporter = {
			type : 'lcov',
			dir : 'coverage/'
		},
		configuration.singleRun = true;
	}

	config.set(configuration)
}
<commit_msg>Removed info<commit_after>// Karma configuration

module.exports = function(config) {
	var configuration = {
		// 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
		frameworks: ['jasmine'],

		// list of files / patterns to load in the browser
		files: [
			'src/scripts/*.js',
			'spec/my-test.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
		preprocessors: {
			'scripts/*.js' : ['coverage']
		},

		// configure the reporter
		coverageReporter: {
			type : 'html',
			dir : 'coverage/'
		},

		// test results reporter to use
		// possible values: 'dots', 'progress'
		// available reporters: https://npmjs.org/browse/keyword/karma-reporter
		reporters: ['progress', 'coverage'],

		// 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'],

		customLaunchers: {
			Chrome_travis_ci: {
					base: 'Chrome',
					flags: ['--no-sandbox']
			}
		},

		// Continuous Integration mode
		// if true, Karma captures browsers, runs the tests and exits
		singleRun: false

	};

	if(process.env.TRAVIS){
		configuration.browsers = ['Chrome_travis_ci'],
		configuration.coverageReporter = {
			type : 'lcov',
			dir : 'coverage/'
		},
		configuration.singleRun = true;
	}

	config.set(configuration)
}
<|endoftext|>


<commit_before>// Karma configuration
module.exports = function (config) {
  var configuration = {

    // 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
    frameworks: ['mocha', 'chai-sinon'],

    // list of files / patterns to load in the browser
    // not sure why tests are failing when files are loaded in bulk
    files: [
      'node_modules/leaflet/dist/leaflet.css',
      'node_modules/leaflet/dist/leaflet-src.js',
      'dist/esri-leaflet-debug.js',
      'spec/Layers/DynamicMapLayerSpec.js',
      'spec/Layers/ImageMapLayerSpec.js',
      'spec/**/!(ImageMapLayer|DynamicMapLayer)*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
    preprocessors: {
      'dist/**/*.js': ['sourcemap', 'coverage']
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['mocha', 'coverage'],

    // web server port
    port: 9876,

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

    // enable / disable colors in the output (reporters and logs)
    colors: true,

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

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome1280x1024'],

    customLaunchers: {
      Chrome1280x1024: {
        base: 'ChromeHeadless',
        // increased viewport is required for some tests (TODO fix tests)
        // https://github.com/Leaflet/Leaflet/issues/7113#issuecomment-619528577
        flags: ['--window-size=1280,1024']
      },
      FirefoxTouch: {
        base: 'FirefoxHeadless',
        prefs: {
          'dom.w3c_touch_events.enabled': 1
        }
      },
      FirefoxNoTouch: {
        base: 'FirefoxHeadless',
        prefs: {
          'dom.w3c_touch_events.enabled': 0
        }
      },
      IE10: {
        base: 'IE',
        'x-ua-compatible': 'IE=EmulateIE10'
      }
    },

    concurrency: 1,

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

    // Timeout for the client socket connection [ms].
    browserSocketTimeout: 30000,

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true,

    client: {
      mocha: {
        // eslint-disable-next-line no-undef
        forbidOnly: process.env.CI || false
      }
    },

    // Configure the coverage reporters
    coverageReporter: {
      reporters: [
        {
          type: 'html',
          dir: 'coverage/'
        }, {
          type: 'text'
        }
      ]
    }
  };

  config.set(configuration);
};
<commit_msg>remove IE config<commit_after>// Karma configuration
module.exports = function (config) {
  var configuration = {

    // 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
    frameworks: ['mocha', 'chai-sinon'],

    // list of files / patterns to load in the browser
    // not sure why tests are failing when files are loaded in bulk
    files: [
      'node_modules/leaflet/dist/leaflet.css',
      'node_modules/leaflet/dist/leaflet-src.js',
      'dist/esri-leaflet-debug.js',
      'spec/Layers/DynamicMapLayerSpec.js',
      'spec/Layers/ImageMapLayerSpec.js',
      'spec/**/!(ImageMapLayer|DynamicMapLayer)*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
    preprocessors: {
      'dist/**/*.js': ['sourcemap', 'coverage']
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['mocha', 'coverage'],

    // web server port
    port: 9876,

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

    // enable / disable colors in the output (reporters and logs)
    colors: true,

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

    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome1280x1024'],

    customLaunchers: {
      Chrome1280x1024: {
        base: 'ChromeHeadless',
        // increased viewport is required for some tests (TODO fix tests)
        // https://github.com/Leaflet/Leaflet/issues/7113#issuecomment-619528577
        flags: ['--window-size=1280,1024']
      },
      FirefoxTouch: {
        base: 'FirefoxHeadless',
        prefs: {
          'dom.w3c_touch_events.enabled': 1
        }
      },
      FirefoxNoTouch: {
        base: 'FirefoxHeadless',
        prefs: {
          'dom.w3c_touch_events.enabled': 0
        }
      }
    },

    concurrency: 1,

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

    // Timeout for the client socket connection [ms].
    browserSocketTimeout: 30000,

    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: true,

    client: {
      mocha: {
        // eslint-disable-next-line no-undef
        forbidOnly: process.env.CI || false
      }
    },

    // Configure the coverage reporters
    coverageReporter: {
      reporters: [
        {
          type: 'html',
          dir: 'coverage/'
        }, {
          type: 'text'
        }
      ]
    }
  };

  config.set(configuration);
};
<|endoftext|>