Marc Knaup
12/21/2020, 11:08 PMsuspend fun
from a regular fun
?
I only need that for unit testing a single function and can be sure that the function doesn’t actually suspend nor launch any other coroutines.Robert Jaros
12/21/2020, 11:13 PMGlobalScope.lauch {}
?Marc Knaup
12/21/2020, 11:13 PMRobert Jaros
12/21/2020, 11:17 PMrunBlocking {}
. It was removed because it was "dirty", but I remember it was working somehow 🙂. Maybe you can search in the old sources.Marc Knaup
12/21/2020, 11:18 PMCasey Brooks
12/21/2020, 11:20 PM.launch { }
in a Promise seems to be the most common way of unit testing coroutines, since both Mocha and Karma (the kotlin/JS test runners) support tests that return promisesRobert Jaros
12/21/2020, 11:33 PMwhile(true)
loop ;-)Marc Knaup
12/21/2020, 11:59 PMBlockingEventLoop
, BlockingCoroutine
and all sorts of things 😅