saveourtool/save-cli

Use kotest-assertions

Open

#408 opened on 2022年6月23日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Kotlin (4 forks)auto 404
enhancementgood first issuerefactoringtests

Repository metrics

Stars
 (43 stars)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド