nomisRev / ktor-arrow-example

Real World implementation - "The mother of all demo apps". Written in Kotlin, with Ktor, Arrow, SqlDelight, KotlinX Serialization, etc.
Apache License 2.0
271 stars 34 forks source link

Refactor to kotlin.assert and power-assert #173

Open nomisRev opened 1 year ago

nomisRev commented 1 year ago

Rationale: https://jamesward.com/2023/09/20/asserttrue_test_dsls_legacy/

https://github.com/bnorm/kotlin-power-assert

Kotest shouldBe is not compatible with the required signature of power-assert, so we should refactor to kotlin.test.

tibtof commented 1 year ago

Hi Simon, does this mean replacing kotest altogether or just refactoring the assertions?

nomisRev commented 1 year ago

Hey @tibtof,

Thank you for your interest in the project!

We only need to refactor from Kotest assertions to Kotlin-test assertions to get the benefits of kotlin-power-assert. The rest can stay Kotest.

tibtof commented 1 year ago

Hey Simon, I created a PR with an example. I will continue with the rest of the tests if it's the right direction. However, some assertions are still better in kotest, such as .shoulfBeRight. I would keep the assertions from kotest that also extract a value. Here is an example result:

image