saveourtool/save-cli

Use kotest-assertions

Open

#408 创建于 2022年6月23日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Kotlin (4 fork)auto 404
enhancementgood first issuerefactoringtests

仓库指标

Star
 (43 star)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南