Embed presentation
Download as PDF, PPTX
















![Assertion 結果の分かりやすさ2 elements passed but expected 1The following elements passed:[0] Message(type=TEXT, text=Kotlin)[3] Message(type=TEXT, text=KotlinFest)The following elements failed:[1] Message(type=TEXT, text=Java) => "Java" should startwith "Kotlin" (diverged at index 0)[2] Message(type=TEXT, text=Kotest) => "Kotest" should startwith "Kotlin" (diverged at index 3)forOne - Collection の中にひとつだけマッチする場合のみ成功](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fkotest-kotlinfest2024hktechno-240622075025-e15429a6%2f75%2fKotest-KotlinFest-2024-17-2048.jpg&f=jpg&w=240)
























kotest は、 Kotlin ネイティブなテストフレームワークで、Kotlin で書かれたコードをテストするための強力で便利な機能が多く含まれています。Kotlin/JVM では、テストに JUnit を使っている方が多いと思いますが、アサーションライブラリが Java しか考えていなかったり、coroutines, 非同期処理への対応が弱かったりと、もっと Kotlin の機能を最大限に活用して快適にテストを書きたいと思われる場面も多い事でしょう。kotest は、アサーションライブラリだけを JUnit と組み合わせて使うこともできるし、テストフレームワーク全体を kotest へ置き換えることも可能です。このセッションでは、主に今 JUnit を使ってテストを書いている方を対象に、kotest へ移行するとどんな良いことがあるのか、移行のやり方や具体的な実例を紹介します。
















![Assertion 結果の分かりやすさ2 elements passed but expected 1The following elements passed:[0] Message(type=TEXT, text=Kotlin)[3] Message(type=TEXT, text=KotlinFest)The following elements failed:[1] Message(type=TEXT, text=Java) => "Java" should startwith "Kotlin" (diverged at index 0)[2] Message(type=TEXT, text=Kotest) => "Kotest" should startwith "Kotlin" (diverged at index 3)forOne - Collection の中にひとつだけマッチする場合のみ成功](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fkotest-kotlinfest2024hktechno-240622075025-e15429a6%2f75%2fKotest-KotlinFest-2024-17-2048.jpg&f=jpg&w=240)






















