Ran into a problem because a Spec was running some...
# kotest-contributors
e
Ran into a problem because a Spec was running some initialization behaviour in a
beforeAny
hook. It depended on resources setup by
beforeProject
, which were run after the beforeAny.. wouldn't it be most natural if
beforeProject
runs before any other hooks?
l
I think it would, yes. What I expect is BeforeProject -> BeforeSpecClass -> BeforeSpec -> BeforeContainer -> BeforeTest
(and the reverse order to finish it up)
Can you reproduce it with a simple example?
s
Yeah beforeProject should absolutely be first. Do you have a self container reproducer ?
e
Will try to fix one when I get some time :)
Hmm okay. Seems beforeProject indeed runs first. Must be some other timing issue.
Figured it out.. I had a beforeAny-hook set the baseUri for requests to the docker host. So there was a race condition between the two
beforeAny
-hooks.