Kotlin / Ktor, cant use withtTestApplication because my main is a suspend function
My main looks like this
suspend fun main(testing: Boolean = false) {
// do some db related stuff with coroutines
dbSetupRun() // this is using coroutines
embeddedServer(Netty, 8080) {
...
}.start(wait = true}
and my test code looks like
@Test
suspend fun
test
() {
withTestApplication({ main(testing = true) }) {
handleRequest(HttpMethod.Get, "${config.root}/${config.version}/test").apply {
assertEquals(HttpStatusCode.OK,...