save-cli icon indicating copy to clipboard operation
save-cli copied to clipboard

Use kotest-assertions

Open petertrr opened this issue 3 years ago • 0 comments

kotest-assertions support multiplatform and are much more expressive than what's available in kotlin.test.

For example, this code

reporter.results.forEach { testResult ->
            assertTrue(!testResult.debugInfo!!.execCmd!!.contains("chapter"))
        }

will fail with Expected value to be true.. However with kotest it can be rewritten similarly to

reporter.results shouldNot exist { testResult ->
        testResult.debugInfo!!.execCmd!!.contains("chapter")
}

which will on failure describe the collection that has been tested

petertrr avatar Jun 23 '22 16:06 petertrr