hfhbd
08/16/2021, 9:59 AMError: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
happens with my runTest
implementation using JS IR:
val testScope = MainScope()
fun runTest(block: suspend CoroutineScope.() -> Unit): dynamic = testScope.promise { block() }
hfhbd
08/16/2021, 9:59 AMimport kotlinx.coroutines.*
import kotlin.test.*
import kotlin.time.*
@ExperimentalTime
class TestingRunTest {
@Test
fun a() = runTest {
var a = 1
assertEquals(1, a)
val job = launch {
delay(1.minutes)
a = 42
}
assertEquals(1, a)
job.join()
assertEquals(42, a)
}
}
val testScope = MainScope()
fun runTest(block: suspend CoroutineScope.() -> Unit): dynamic = testScope.promise { block() }
Pitel
08/16/2021, 10:46 AMdelay(1.minutes)
🤔Pitel
08/16/2021, 10:47 AMhfhbd
08/16/2021, 12:13 PMrusshwolf
08/16/2021, 12:59 PMkarma.config.d
directory with a file like this:
https://github.com/touchlab/Stately/blob/44cb17cea1d2fd5f7a5c1793c13fa097a510566a/stately-iso-collections/karma.config.d/timeout-override.jsrusshwolf
08/16/2021, 1:00 PMhfhbd
08/16/2021, 1:03 PM