Commit f4e6cbba by Ehtesham Kafeel Committed by GitHub

Merge pull request #12710 from edx/ekafeel/clean-karma-log

Make karma logs cleaner
parents a361d44b f83efed9
/* This file overrides ExceptionFormatter of jasmine before it's initialization in karma-jasmine's
boot.js. It's important because ExceptionFormatter returns a constructor function. Once the method has been
initialized we can't override the ExceptionFormatter as Jasmine then uses the stored reference to the function */
(function () {
/* globals jasmineRequire */
'use strict';
var OldExceptionFormatter = jasmineRequire.ExceptionFormatter(),
oldExceptionFormatter = new OldExceptionFormatter(),
MAX_STACK_TRACE_LINES = 10;
jasmineRequire.ExceptionFormatter = function () {
function ExceptionFormatter() {
this.message = oldExceptionFormatter.message;
this.stack = function (error) {
var errorMsg = null;
if (error) {
errorMsg = error.stack.split('\n').slice(0, MAX_STACK_TRACE_LINES).join('\n');
}
return errorMsg;
};
}
return ExceptionFormatter;
};
}());
...@@ -84,7 +84,7 @@ function junitNameFormatter(browser, result) { ...@@ -84,7 +84,7 @@ function junitNameFormatter(browser, result) {
* @return {String} * @return {String}
*/ */
function junitClassNameFormatter(browser) { function junitClassNameFormatter(browser) {
return "Javascript." + browser.name.split(" ")[0]; return 'Javascript.' + browser.name.split(' ')[0];
} }
...@@ -227,6 +227,7 @@ var getBaseConfig = function (config, useRequireJs) { ...@@ -227,6 +227,7 @@ var getBaseConfig = function (config, useRequireJs) {
var files = [ var files = [
'node_modules/jquery/dist/jquery.js', 'node_modules/jquery/dist/jquery.js',
'node_modules/jasmine-core/lib/jasmine-core/jasmine.js', 'node_modules/jasmine-core/lib/jasmine-core/jasmine.js',
'common/static/common/js/jasmine_stack_trace.js',
'node_modules/karma-jasmine/lib/boot.js', 'node_modules/karma-jasmine/lib/boot.js',
'node_modules/karma-jasmine/lib/adapter.js', 'node_modules/karma-jasmine/lib/adapter.js',
'node_modules/jasmine-jquery/lib/jasmine-jquery.js' 'node_modules/jasmine-jquery/lib/jasmine-jquery.js'
...@@ -292,6 +293,12 @@ var getBaseConfig = function (config, useRequireJs) { ...@@ -292,6 +293,12 @@ var getBaseConfig = function (config, useRequireJs) {
// karma-reporter // karma-reporter
reporters: reporters(config), reporters: reporters(config),
// Spec Reporter configuration
specReporter: {
maxLogLines: 5,
showSpecTiming: true
},
coverageReporter: coverageSettings(config), coverageReporter: coverageSettings(config),
...@@ -330,7 +337,11 @@ var getBaseConfig = function (config, useRequireJs) { ...@@ -330,7 +337,11 @@ var getBaseConfig = function (config, useRequireJs) {
// how many browser should be started simultaneous // how many browser should be started simultaneous
concurrency: Infinity, concurrency: Infinity,
browserNoActivityTimeout: 50000 browserNoActivityTimeout: 50000,
client: {
captureConsole: false
}
}; };
}; };
......
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