Hi,
I read that if one of the tests in a suite fails - the beforeAll hook is running again (As the worker disposed)
I have a case when my beforeAll hook used for a data preparation using API calls.
In addition, my application has a limitation that I can't create a duplication of an entity.
As mentioned, if one of the tests in a suite failed - beforeAll hook is running again and due to the duplication limitation, the beforeAll hook failed and all tests failed accordingly as well.
I was wonder what could be the best practice in such case?
Currently I implemented it using a fixture which is called only from the first test in the suite, but I feel it's not the best practice.
Hi,
I read that if one of the tests in a suite fails - the
beforeAllhook is running again (As the worker disposed)I have a case when my
beforeAllhook used for a data preparation using API calls.In addition, my application has a limitation that I can't create a duplication of an entity.
As mentioned, if one of the tests in a suite failed -
beforeAllhook is running again and due to the duplication limitation, thebeforeAllhook failed and all tests failed accordingly as well.I was wonder what could be the best practice in such case?
Currently I implemented it using a fixture which is called only from the first test in the suite, but I feel it's not the best practice.