Skip to content

Commit

Permalink
Add test to error-message
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 7, 2024
1 parent 3a1dbf1 commit 18aebfb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/error-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ test.snapshot({
'throw new Error({foo: 0}.foo)',
'throw new Error(lineNumber=2)',
'const error = new RangeError;',
'throw Object.assign(new Error(), {foo})',
],
});

Expand Down
15 changes: 15 additions & 0 deletions test/snapshots/error-message.mjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,21 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^^^^^ Pass a message to the \`RangeError\` constructor.␊
`

## invalid(19): throw Object.assign(new Error(), {foo})

> Input
`␊
1 | throw Object.assign(new Error(), {foo})␊
`

> Error 1/1
`␊
> 1 | throw Object.assign(new Error(), {foo})␊
| ^^^^^^^^^^^ Pass a message to the \`Error\` constructor.␊
`

## invalid(1): new AggregateError(errors)

> Input
Expand Down
Binary file modified test/snapshots/error-message.mjs.snap
Binary file not shown.

0 comments on commit 18aebfb

Please sign in to comment.