Is there a way to avoid using runBlocking
in tests?
I currently have the following:
class ServerTest {
@Test fun testLocalServer() = runBlocking {
...
}
@Test fun testStagedServer() = runBlocking {
...
}
}
I would like this to somehow become:
@Test fun testLocalServer() {
...
}
@Test fun testStagedServer() {
...
}
Basically, I want my code to look like the second code block but still behave exactly like the first code block. I am assuming that I will want every single one of my tests to run inside of a runBlocking
block, so it’s redundant to keep writing it.