What is the recommended way to unit test suspending code in Kotlin/JS? I've been using https://stackoverflow.com/questions/47956444/how-to-unit-test-kotlin-js-code-with-coroutines for a while, but when there are many tests, some timeout. If I run tests by one, they never timeout, but if I run all of them, 2–3 tests timeout (different ones everytime). I'm starting to think returning a Promise means they all start at the same time, and some have to wait for the others to finish so there are enough threads?
What can I do to solve this?
t
thana
12/21/2020, 3:55 PM
nothing changed since
r
russhwolf
12/21/2020, 4:20 PM
The JS test runners have a global timeout that I think is 2 seconds by default. You can override for node by doing something like this in your gradle file