Merge branch 'puglyfe-aggregate-errors'
* Adds support for AggregateError * Merges #2093 from @puglyfe * Fixes #2063
This commit is contained in:
@@ -4003,7 +4003,8 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) {
|
||||
'lineNumber',
|
||||
'column',
|
||||
'description',
|
||||
'jasmineMessage'
|
||||
'jasmineMessage',
|
||||
'errors'
|
||||
];
|
||||
|
||||
function ExceptionFormatter(options) {
|
||||
@@ -4069,6 +4070,18 @@ getJasmineRequireObj().ExceptionFormatter = function(j$) {
|
||||
lines = lines.concat(substack);
|
||||
}
|
||||
|
||||
if (Array.isArray(error.errors)) {
|
||||
error.errors.forEach((aggregatedError, index) => {
|
||||
if (aggregatedError instanceof Error) {
|
||||
const substack = this.stack_(aggregatedError, {
|
||||
messageHandling: 'require'
|
||||
});
|
||||
substack[0] = 'Error ' + (index + 1) + ': ' + substack[0];
|
||||
lines = lines.concat(substack);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return lines;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user