Files
edx-platform/common/static/common/js/jasmine_stack_trace.js
Syed Ali Abbas Zaidi d7053a6783 fix: eslint autofixable issues (#32181)
* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint line around directives issue

* fix: eslint semi rule

* fix: eslint newline per chain rule

* fix: eslint space infix ops rule

* fix: eslint space-in-parens issue

* fix: eslint space before function paren issue

* fix: eslint space before blocks issue

* fix: eslint arrow body style issue

* fix: eslint dot-location issue

* fix: eslint quotes issue

* fix: eslint quote props issue

* fix: eslint operator assignment issue

* fix: eslint new line after import issue

* fix: indent issues

* fix: operator assignment issue

* fix: all autofixable eslint issues

* fix: all react related fixable issues

* fix: autofixable eslint issues

* chore: remove all template literals

* fix: remaining autofixable issues

* fix: failing js test
2023-05-18 11:03:59 +05:00

30 lines
1.0 KiB
JavaScript

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