Improve formatting of AggregateErrors

This commit is contained in:
Steve Gravrock
2026-02-07 18:22:12 -08:00
parent b88ce2d49f
commit 6af5d24b3b
3 changed files with 38 additions and 34 deletions

View File

@@ -4071,15 +4071,16 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) {
}
if (Array.isArray(error.errors)) {
error.errors.forEach((aggregatedError, index) => {
if (aggregatedError instanceof Error) {
const substack = this.stack_(aggregatedError, {
for (let i = 0; i < error.errors.length; i++) {
if (error.errors[i] instanceof Error) {
lines.push('');
const substack = this.stack_(error.errors[i], {
messageHandling: 'require'
});
substack[0] = 'Error ' + (index + 1) + ': ' + substack[0];
lines = lines.concat(substack);
substack[0] = 'Error ' + (i + 1) + ': ' + substack[0];
lines = lines.concat(substack.map(x => ' ' + x));
}
});
}
}
return lines;