Is there a way to run code when a Jest test times out?

Viewed 12

Some of my Jest tests are acquiring locks with async-mutex. When these tests occasionally time out, the locks remain acquired which causes other tests to fail, polluting the log output and making it harder to tell which test was the culprit.

I just realized that I can release all locks in an afterEach hook each time. I'm still curious if there is something like an onTimeout I can set. That would also be more efficient.

0 Answers
Related