I use the globalteardown hook in jest.config.js.
It works fine.
Now i need to do something in teardown script conditionally, only if there is any failed tests, the question is how can i check if there were any failure?
The project is written in Nodejs with Jest and PactumJS.
Thanks in advance
Actual behav: globalteardown script actions are executed always.
Expected: do somdthing in globalteardown only if any test failed
New contributor
Federico Francia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.