I thought recently that Kotlin would need a powerful testing framework like ScalaTest. Now I’m happy someone actually ported it to Kotlin and named it … KotlinTest! It doesn’t support all features of ScalaTest yet, but it looks promising.
I’m a fan of flatspec, since it is pretty readable without introducing too much nested blocks and documentation nobody cares about. Confusing unit tests with “executable specs”, like other testing styles do, is not very helpful, since such tests are not read by business users. In my opinion it is much better to keep unit tests clean, simple and flat and use a BDD framework like Cucumber for high-level acceptance tests. So for me, it’s great news to hear about KotlinTest!
As the author, I’m pleased you like it. Please create any tickets on github if you need extra features. Did you find it via the kotlin blog I put up yesterday?
im just trying it out in a gradle project.
in intellij everything is fine, but when running gradle test it does not work.
eg this test passes in gradle but fails in IJ
``
class AnotherTest() : FunSpec(), Logging {
override val log: Logger by lazyLogger()