saveourtool/save-cli

Use kotest-assertions

Open

#408 geöffnet am 23. Juni 2022

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Kotlin (4 Forks)auto 404
enhancementgood first issuerefactoringtests

Repository-Metriken

Stars
 (43 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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

Contributor Guide