Can anyone help me understand the purpose of the `...
# getting-started
e
Can anyone help me understand the purpose of the
kotlin.test
library? I read that it provides annotations independent of the testing framework used, but why import this over plain old JUnit?
c
kotlin.test
is for multiplatform testing while JUnit is JVM-only, though there are other options for multiplatform test frameworks like #kotest
e
Oh, that makes sense. I have only done stuff on the JVM so I was having trouble imagining a use case for me. Thanks
s
there is another tiny advantage of using kotlin.test: • it's a native Kotlin lib so it knows about nullability. If you use kotlin.test's version of
assertNotNull
the variable will be smartcasted to not-null after the test.