You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a test is skipped at runtime (e.g., by calling test.skip()), I expect the beforeEach and the afterEach hooks to either both be skipped or both run.
Actual behavior
If a test is skipped at runtime (e.g., by calling test.skip()), I am seeing that the beforeEach hooks are skipped and the afterEach hooks are run, which is causing unexpected test failures for the skipped tests.
@jessewjoseph I've tried your snippet in v1.42.1 and v1.43.1 - both versions run all beforeEach hooks and skip the test.
This is by design, because the test runner cannot differentiate between hooks and does not have an idea which hooks should be skipped at which point. So far, the rule is "once we started running beforeEach hooks, we must run all of them and also run all afterEach hooks at the end". Otherwise, the rules would get complicated and/or we'll get into other edge cases that do not work for someone.
Dang, yeah that's right. I spent too long poking at this and got my wires crossed, sorry about that.
It's just the original issue John posted then where a skip in an auto fixture used to prevent beforeEach and afterEach hooks from executing, but now executes afterEach.
Version
1.43.1
Steps to reproduce
We were able to reproduce with the following:
This test passes on v1.42.1 but not v1.43.1.
Expected behavior
If a test is skipped at runtime (e.g., by calling test.skip()), I expect the beforeEach and the afterEach hooks to either both be skipped or both run.
Actual behavior
If a test is skipped at runtime (e.g., by calling test.skip()), I am seeing that the beforeEach hooks are skipped and the afterEach hooks are run, which is causing unexpected test failures for the skipped tests.
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: