Hi, can someone explain me how to implement an ana...
# multiplatform
s
Hi, can someone explain me how to implement an analogue @AfterAll annotation in kotlin.test without "junit, testng, kotest, ..." to stop container with database through TestContainers? I am using constructor init {} to implement an analogue @BeforeAll annotation, but there is no destructor in Kotlin and it is not clear to me how to implement this with native language constructs with native test execution flow.
j
There's
@kotlin.test.AfterClass
in Kotlin/Native. It's not available in common. But there's also
@org.junit.AfterClass
you could typealias a common annotation to support JVM as well. What targets do you need to support?
s
Now I'm planning to support JVM and NodeJS targets
j
TestNG also has an
@AfterClass
annotation you might be able to typealias to as well, but I've not tried this with Kotlin/JS myself.
There's this YouTrack issue.