Hi ya, is there an a way to run some “after all te...
# kotest
t
Hi ya, is there an a way to run some “after all tests / specs” logic? At the moment i’m using
Runtime.getRuntime().addShutdownHook(…)
but was curious if there’s something exposed by kotest to more easily accomplish this?
w
Yes, you can extend
AbstractProjectConfig
and override the `beforeAll`/`afterAll` methods. Some docs about project configuration class (although it doesn’t mention the before/after hooks): https://kotest.io/docs/framework/project-config.html
🙏 1
t
Looks to be deprecated with beforeProject/afterProject as the recoomended methods now
w
Ah might be, I still haven’t upgraded to 5.x 😬 In any case hooks are there 🙂
t
beforeAll/afterAll are still there just have deprecation warnings now
but this is what I was looking for so thanks for hat
👍 1
s
You can make project listener and add it to project config. That way you can use suspend functions. But the deprecated versions work too