Don't leak errorWithStack in late async expectation failures

This commit is contained in:
Steve Gravrock
2025-09-21 08:34:59 -07:00
parent e2a7740322
commit 17c0567bae
5 changed files with 20 additions and 10 deletions

View File

@@ -1354,7 +1354,7 @@ getJasmineRequireObj().Env = function(j$) {
'2. Was done() invoked before an async operation completed?\n' +
'3. Did an expectation follow a call to done()?';
topSuite.result.failedExpectations.push(delayedExpectationResult);
topSuite.addExpectationResult(false, delayedExpectationResult);
}
function routeLateFailure(expectationResult) {
@@ -2527,7 +2527,8 @@ getJasmineRequireObj().buildExpectationResult = function(j$) {
matcherName: options.matcherName,
message: message(),
stack: options.omitStackTrace ? '' : stack(),
passed: options.passed
passed: options.passed,
globalErrorType: options.globalErrorType
};
if (!result.passed) {
@@ -8620,7 +8621,7 @@ getJasmineRequireObj().ReportDispatcher = function(j$) {
return;
}
const thisEvent = j$.util.clone(event);
const thisEvent = structuredClone(event);
if (fn.length <= 1) {
fns.push({
fn: function() {