Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(testing): assertThrowsAsync always reporting Error instead of actual error class #1051

Merged
merged 2 commits into from
Jul 26, 2021
Merged
Changes from 1 commit
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
Next Next commit
fix: assertThrowsAsync always reporting Error instead of ErrorClass
lowlighter committed Jul 21, 2021

Unverified

This user has not yet uploaded their public signing key.
commit 5955556a5b37a5fceb3054a2bd4f80fd665d0efe
2 changes: 1 addition & 1 deletion testing/asserts.ts
Original file line number Diff line number Diff line change
@@ -641,7 +641,7 @@ export async function assertThrowsAsync<T = void>(
}
if (ErrorClass && !(e instanceof ErrorClass)) {
msg =
`Expected error to be instance of "${ErrorClass.name}", but got "${e.name}"${
`Expected error to be instance of "${ErrorClass.name}", but was "${e.constructor.name}"${
msg ? `: ${msg}` : "."
}`;
throw new AssertionError(msg);