Hi ! I'm trying to test my KMP project, but wasmJs...
# webassembly
a
Hi ! I'm trying to test my KMP project, but wasmJs tests currently fail. I need to do some database initialyzation (basically call suspends methods) and then test the ui. I am currently using
runComposeUiTest
in commonMain. It seems like nesting a
runTest
inside it doesn't work as the js test doesn't wait for it to finish. What are the alternative ? Thanks
o
You could try TestBalloon. Its fixtures support suspending initialization.
👀 1
r
runTest
in js requires that your test be of the form
@Test fun myTest() = runTest { ... }
o
True for
kotlin-test
. TestBalloon does not have this limitation, and provides complete
runTest
functionality by default in each test, unless you choose otherwise.
a
It seems that TestBalloon does the trick, thanks ! @russhwolf that's the limitation I would like to avoid
👍 1