Is this still the standard way to run suspending f...
# spek
m
Is this still the standard way to run suspending functions in Spek test? (Using
runBlocking
)
Copy code
Then("event store should be empty") {
        runBlocking {
          // findAll is a suspending function
          eventStore.findAll().shouldBeRight { it.shouldBeEmpty() }
        }
      }
Its not the biggest deal, although it does make some tests a bit more verbose. I see some talk about this in the channel history but wasn’t sure if this was still the cleanest way to do it
r
Unfortunately yes, but that will change in
2.1
- which will add support for coroutines - you can run suspending functions within `test`s and fixtures.