Any idea why `@AfterTest` is ran before `@Test` re...
# multiplatform
p
Any idea why
@AfterTest
is ran before
@Test
returning JS promise finishes in Node.js test?
👀 2
Copy code
import kotlin.test.AfterTest
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertTrue
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.promise

class PromiseTest {
  var inTest = false

  @BeforeTest
  fun before() {
    inTest = true
  }

  @AfterTest
  fun after() {
    inTest = false
  }

  @Test
  fun withoutPromise() {
    assertTrue(inTest)
  }

  @Test
  fun withPromise() = GlobalScope.promise {
    assertTrue(inTest) // FAIL?!
  }
}
Also happens in
browserTest
.
Maybe, #kotest will be the soilution, aftere they finis the IR support. https://github.com/kotest/kotest/issues/2163