How might I check if any jest tests failed from within an afterAll block?

Viewed 295

I am using jest with playwright to run the tests on my web application. I am recording videos for each test but as there are 100s of test which we are to running daily, we are going out of space on our server. so we decided to only save the videos of those test which has failed so my question is that is there any way i can know in the afterall block weather the test has failed or passed following is the code which i am using

beforeAll(async () => {
    // start the recording
})

afterAll(async()=>{
    // stop and save the recording if the test has failed other wise delete it
    // here i need to check if the test has failed or passed
});

I wanted this behaviour How might I check if any mocha tests failed from within an after block?

0 Answers
Related