Big Chungus
08/21/2021, 5:24 PMcommonTest
. This is achieved via kotlin compiler plugin that injects relevant keys and paths to store and read assertion values during compilation.
It's also test framework agnostic and exposes sufficient configuration for you to write your own klip assertion functions. Here's a little preview:
class MyTest {
data class DomainObject(val name: String, val value: String?)
@Test
fun test1() {
assertMatchesClip(DomainObject("Dick", "Dickens"))
DomainObject("John", "Doe").assertKlip()
}
@Test
fun test2() {
doAssertions()
}
private fun doAssertions() {
assertMatchesClip(DomainObject("Joe", "Mama"))
DomainObject("Ben", "Dover").assertKlip()
}
}
It's still in preview as not all "testable" kotlin targets are implemented yet, but please give it a go and get back to me with your thoughts.
Happy coding!
Slack Conversation