Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ exports[`should return the error cause if there is one 1`] = `
Cause:
Cause Error

<dim>at Object.<anonymous> (</intensity>packages/jest-message-util/src/__tests__/messages.test.ts<dim>:567:17)</intensity>
<dim>at Object.<anonymous> (</intensity>packages/jest-message-util/src/__tests__/messages.test.ts<dim>:565:12)</intensity>

"
`;
Expand All @@ -173,16 +173,16 @@ exports[`should return the inner errors of an AggregateError 1`] = `

AggregateError:

<dim>at Object.<anonymous> (</intensity>packages/jest-message-util/src/__tests__/messages.test.ts<dim>:583:20)</intensity>
<dim>at Object.<anonymous> (</intensity>packages/jest-message-util/src/__tests__/messages.test.ts<dim>:582:20)</intensity>

Errors contained in AggregateError:
Err 1

<dim>at Object.<anonymous> (</intensity>packages/jest-message-util/src/__tests__/messages.test.ts<dim>:583:40)</intensity>
<dim>at Object.<anonymous> (</intensity>packages/jest-message-util/src/__tests__/messages.test.ts<dim>:582:40)</intensity>

Err 2

<dim>at Object.<anonymous> (</intensity>packages/jest-message-util/src/__tests__/messages.test.ts<dim>:583:60)</intensity>
<dim>at Object.<anonymous> (</intensity>packages/jest-message-util/src/__tests__/messages.test.ts<dim>:582:60)</intensity>

"
`;
7 changes: 3 additions & 4 deletions packages/jest-message-util/src/__tests__/messages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,9 @@ it('getTopFrame should return a path for mjs files', () => {
});

it('should return the error cause if there is one', () => {
const error = new Error('Test exception');
// TODO pass `cause` to the `Error` constructor when lowest supported Node version is 16.9.0 and above
// See https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V16.md#error-cause
error.cause = new Error('Cause Error');
const error = new Error('Test exception', {
cause: new Error('Cause Error'),
});
const message = formatExecError(
error,
{
Expand Down
Loading