-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Disable snapshots and try assertions in hooks #2523
Comments
Hello @novemberborn if (test.isHook) {
throw new Error(`t.try() is not allowed in hooks.`);
} and for the |
@okyantoro that sounds about right. It may be nice to add a more explicit Since you seem keen I'll assign this to you. Apologies if that was presumptuous. |
Thank you @novemberborn |
`t.try()` has never worked in hooks. Fail the hook properly instead of letting it crash. `t.snapshot()` sort of works, but not really. Add an experiment so support can be disabled. This will become the default behavior in the next major AVA release. Fixes #2523. Co-authored-by: Mark Wubben <mark@novemberborn.net>
Per #2511,
t.try()
does not work in hooks. Rather than crashing we should fail the hook properly.Snapshots work in hooks. It's OK in pre-test hooks, since those have unique titles, but the behavior is a little odd in the file hooks. I don't see how this is useful. Let's make snapshots-in-hooks fail. Unfortunately this is a breaking change, so we'll have to put this behind a flag.
The text was updated successfully, but these errors were encountered: