Don't mutate suite's failedExpectations from env
This commit is contained in:
@@ -68,7 +68,7 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
if (!envOptions.suppressLoadErrors) {
|
||||
installGlobalErrors();
|
||||
globalErrors.pushListener(function loadtimeErrorHandler(error) {
|
||||
topSuite.result.failedExpectations.push({
|
||||
topSuite.addExpectationResult(false, {
|
||||
passed: false,
|
||||
globalErrorType: 'load',
|
||||
message: error.message,
|
||||
|
||||
@@ -23,6 +23,13 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
|
||||
globalErrorType: options.globalErrorType
|
||||
};
|
||||
|
||||
if (options.filename !== undefined) {
|
||||
result.filename = options.filename;
|
||||
}
|
||||
if (options.lineno !== undefined) {
|
||||
result.lineno = options.lineno;
|
||||
}
|
||||
|
||||
if (!result.passed) {
|
||||
if (options.error && !j$.private.isString(options.error)) {
|
||||
if ('code' in options.error) {
|
||||
|
||||
Reference in New Issue
Block a user