Commit cae69f96 by Andy Armstrong Committed by GitHub

Merge pull request #12810 from edx/andya/no-karma-firefox-modals

Don't auto-update during Karma test runs
parents 5e4ce786 f7133089
...@@ -172,7 +172,7 @@ var defaultNormalizeFunc = function (appRoot, pattern) { ...@@ -172,7 +172,7 @@ var defaultNormalizeFunc = function (appRoot, pattern) {
pattern = path.join(appRoot, '/common/static/' + pattern); pattern = path.join(appRoot, '/common/static/' + pattern);
} else if (pattern.match(/^xmodule_js\/common_static/)) { } else if (pattern.match(/^xmodule_js\/common_static/)) {
pattern = path.join(appRoot, '/common/static/' + pattern = path.join(appRoot, '/common/static/' +
pattern.replace(/^xmodule_js\/common_static\//, '')); pattern.replace(/^xmodule_js\/common_static\//, ''));
} }
return pattern; return pattern;
}; };
...@@ -183,7 +183,7 @@ var normalizePathsForCoverage = function(files, normalizeFunc) { ...@@ -183,7 +183,7 @@ var normalizePathsForCoverage = function(files, normalizeFunc) {
files.forEach(function (file) { files.forEach(function (file) {
if (!file.ignoreCoverage) { if (!file.ignoreCoverage) {
filesForCoverage[normalizeFn(appRoot, file.pattern)] = ['coverage']; filesForCoverage[normalizeFn(appRoot, file.pattern)] = ['coverage'];
} }
}); });
...@@ -325,8 +325,18 @@ var getBaseConfig = function (config, useRequireJs) { ...@@ -325,8 +325,18 @@ var getBaseConfig = function (config, useRequireJs) {
// start these browsers // start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Firefox'], browsers: ['FirefoxNoUpdates'],
customLaunchers: {
// Firefox configuration that doesn't perform auto-updates
FirefoxNoUpdates: {
base: 'Firefox',
prefs: {
'app.update.auto': false,
'app.update.enabled': false
}
}
},
// Continuous Integration mode // Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits // if true, Karma captures browsers, runs the tests and exits
...@@ -366,7 +376,7 @@ var configure = function(config, options) { ...@@ -366,7 +376,7 @@ var configure = function(config, options) {
); );
if (useRequireJs) { if (useRequireJs) {
files.unshift({pattern: 'common/js/utils/require-serial.js', included: true}); files.unshift({pattern: 'common/js/utils/require-serial.js', included: true});
} }
// Karma sets included=true by default. // Karma sets included=true by default.
...@@ -388,9 +398,9 @@ var configure = function(config, options) { ...@@ -388,9 +398,9 @@ var configure = function(config, options) {
// If we give symlink paths to Istanbul, coverage for each path gets tracked // If we give symlink paths to Istanbul, coverage for each path gets tracked
// separately. So we pass absolute paths to the karma-coverage preprocessor. // separately. So we pass absolute paths to the karma-coverage preprocessor.
var preprocessors = _.extend( var preprocessors = _.extend(
{}, {},
options.preprocessors, options.preprocessors,
normalizePathsForCoverage(filesForCoverage, options.normalizePathsForCoverageFunc) normalizePathsForCoverage(filesForCoverage, options.normalizePathsForCoverageFunc)
); );
config.set(_.extend(baseConfig, { config.set(_.extend(baseConfig, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment