While writing tests in Kotlin, we can leverage the same tools and APIs that we are familiar with from testing Java. However, like other aspects of working with Kotlin, we can make use of Kotlin language features to improve the testing experience. More concretely, there are annotations and libraries specific to Kotlin that enable us to write more fluent, expressive, Kotlin-idiomatic tests, thereby improving the overall testing experience. We'll examine these in the following sections.
Improved testing with Kotlin
The kotlin.test library
The kotlin.test library is a core library provided by Kotlin. Its aim is to provide helper functions and annotations to be used in a test framework-independent fashion. These annotations...