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
Extra: default startup with npx playwright test and TypeScript
Code Snippet
import{expect,test}from'@playwright/test';constbfeWithFailure=()=>{thrownewError('123');};constbfeWithLog=()=>console.log('should not be called');test.describe.only('test',()=>{test.beforeEach(bfeWithFailure);test.beforeEach(bfeWithLog);test('should not be called',()=>{expect(1).toBe(1);});});
Describe the bug
Prepare the flow with unhandled error in the first beforeEach block
Run test example
Actual result:bfeWithLog is called. Expected result:bfeWithLog is not called.
The text was updated successfully, but these errors were encountered:
Update: Looks like I missed to put any other test frameworks results.
In Jest(tested with: 26.5.3) the behavior the same even if couple of tickets were directly addressed to beforeAll with async callback.
It looks like our current behavior matches jest/jasmine. What you are describing is mocha style, where the failing hook stops the next hook from running. That gets tricky when you have a pattern like
before(()=>{// set up something important});after(()=>{// throw an error});after(()=>{// tear down the important thing});
The first failing after causes the second not to run, but it might be very important that it runs. There are pros and cons of each approach, so let's stick with what we have.
Context:
Code Snippet
Describe the bug
Actual result: bfeWithLog is called.
Expected result: bfeWithLog is not called.
The text was updated successfully, but these errors were encountered: