Alex Kuznetsov
04/22/2024, 12:55 PMLeoColman
04/22/2024, 1:14 PMshouldBe
is delicious to use
• Testing styles that allow for nesting and more complex per-test configuration
• Plain Kotlin code -- Fits with everything that's Kotlin related without loops and hoopsLeoColman
04/22/2024, 1:15 PMAlex Kuznetsov
04/22/2024, 1:24 PMAlex Kuznetsov
04/22/2024, 1:25 PMLeoColman
04/22/2024, 1:27 PMBut are there good examples of "coroutines ready" - I've tried that but it did not work well.Call a suspend function in JUnit. Now call it it Kotest. Kotest just runs it, JUnit needs
runBlocking
or runBlockingTest
and then your test is blocking and no longer coroutinesAlex Kuznetsov
04/22/2024, 1:27 PMLukasz Kalnik
04/22/2024, 2:02 PMLukasz Kalnik
04/22/2024, 2:03 PMrunTest
should be usedLukasz Kalnik
04/22/2024, 2:04 PMtestScheduler
from parents:
https://github.com/kotest/kotest/issues/3705Oliver.O
04/22/2024, 3:20 PMfor (animal in listOf("cat", dog", "bird")) {
test("feeding $animal") {
...
}
}
• Context information for failing tests via withClue()
.
• Non-deterministic testing (eventually()
, ...)Alex Kuznetsov
04/22/2024, 3:22 PMeventually()
is used?Oliver.O
04/22/2024, 3:24 PMOliver.O
04/22/2024, 3:27 PMeventuallyTimestamped(5.seconds, "Waiting for the frontend's service startup") {
compositionIsReady() shouldBe true
frontend.context.service shouldNotBe null
}
Alex Kuznetsov
04/22/2024, 3:28 PMOliver.O
04/22/2024, 3:30 PMAlex Kuznetsov
04/22/2024, 3:31 PMAlex Kuznetsov
04/22/2024, 3:32 PMOliver.O
04/22/2024, 3:34 PMAlex Kuznetsov
04/22/2024, 3:39 PMOliver.O
04/22/2024, 3:48 PM