Contentious question... What should I be using for testing & why?
r
randomcat
12/17/2020, 6:46 PM
I use kotlin.test over JUnit 5 and it works fine for me
r
Rob Elliot
12/17/2020, 6:52 PM
kotest has worked best for me so far.
Rob Elliot
12/17/2020, 6:54 PM
Tests are objects registered by a method, which makes it very flexible and easy to generate tests programmatically. Active project, nice set of assertions.
I found that unfortunately Junit 5 is only mature and complete solution. All test libraries for Kotlin which I checked have too strange api (language abuse all around) or too simplistic (kotlin.test, which has even less features then Junit 4) or just never left proof of concept stage.
I had big hopes for Spek, but development of it very slow, many bugs and looks that it doesn't scale properly
But maybe I will do one more attempt to find something (mostly for mpp, don't see for now reason to use something except Junit on JVM), or hope that one day it will be full featured library for testa by Kotlin team (Kotlin.test 2.0)