https://kotlinlang.org logo
Title
m

mbonnin

07/28/2022, 2:04 PM
CanI have the JS Promise handling of
runTest {}
but not the delay-skipping behaviour? Delays are a part of the behaviour I want to test
e

ephemient

07/28/2022, 2:06 PM
I believe you can write a
suspend fun
or
Promise
-returning test function on KJS
m

Matthias Geisler

07/28/2022, 2:06 PM
Something like here?
e

ephemient

07/28/2022, 2:07 PM
but mocha and karma have pretty low test timeout values IIRC
m

mbonnin

07/28/2022, 2:10 PM
I believe you can write a
suspend fun
or
Promise
-returning test function on KJS
I wanted to avoid the expect/actual but I guess that'd work 👍
t

Tom Yuval

09/12/2022, 8:58 AM
Happened to stumble upon this thread, so in case this is still relevant for anyone: I’ve recently written a tiny library specifically for that: https://github.com/tomuvak/testing-coroutines. It provides a single function (called
asyncTest
) to replace
runTest
.