In a multiplatform project, how would one go about to write a test for an asynchronous function(Currently using coroutines) in common code? The frameworks that exist seems to handle multiplatform setups pretty bad. I'd really want to write a simple REST call test to feel save about the current test suite
runBlocking would have been one solution to this, but sadly it does not work in common code (see commonTest)
and use mocha (which support test returning promise) for the JS tests
j
JoakimForslund
12/18/2018, 3:22 PM
Yeah I guess it makes sense to write the tests out on platform level, since the REST calls make use of ktor.. was kind of hoping I would not have to do that for mocking, but I understand it might be the only solution as of now
d
dany
12/18/2018, 3:30 PM
you can write your test in the common modules and just gives some implementation details per platform (the test engine for example)