Skip to content

Conversation

novemberborn
Copy link
Member

@novemberborn novemberborn commented Sep 10, 2023

Fixes #3201.

Assertions now throw a TestFailure error when they fail. This error is not exported or documented and should not be used or thrown manually. You cannot catch this error in order to recover from a failure, use t.try() instead.

All assertions except for throws and throwsAsync now return true when they pass. This is useful for some of the assertions in TypeScript where they can be used as a type guard.

Committing a failed t.try() result now also throws.

@novemberborn novemberborn marked this pull request as ready for review October 22, 2023 19:07
Fixes #3201.

Assertions now throw a `TestFailure` error when they fail. This error is not exported or documented and should not be used or thrown manually. You cannot catch this error in order to recover from a failure, use `t.try()` instead.

All assertions except for `throws` and `throwsAsync` now return `true` when they pass. This is useful for some of the assertions in TypeScript where they can be used as a type guard.

Committing a failed `t.try()` result now also throws.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make assertions throw
1 participant