saveourtool/save-cli

Use kotest-assertions

Open

#408 ouverte le 23 juin 2022

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)Kotlin (4 forks)auto 404
enhancementgood first issuerefactoringtests

Métriques du dépôt

Stars
 (43 stars)
Métriques de merge PR
 (Métriques PR en attente)

Description

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

Guide contributeur