Closed
Description
Next version of Jest will default to using jest-circus as their test runner. Already now many projects change the default runner to instead use jest-circus due to it's superioirity, see https://github.com/facebook/jest/tree/master/packages/jest-circus
jest-circus supports new events fired that can be listened to in test environments via the handleTestEvent
function, see https://jestjs.io/docs/en/configuration#testenvironment-string
As part of this, another PR is ongoing to make them async, see jestjs/jest#9397
With all this in mind, I have two things that would be cool if jest-playwright is a bit proactive to support:
- Support for jest-circus. Maybe this already works?
- Support for
async handleTestEvent
. This could be done easily by a user of jest-playwright by extending the environment, as such https://github.com/smooth-code/jest-puppeteer#extend-puppeteerenvironment. I am thus wondering if this should be the recommended way also in jest-playright (in the readme) or via some other means to catch these events.
note: We want to use this ourselves to take screenshots upon failures.