What is the suggested approach here for unit testi...
# multiplatform
v
What is the suggested approach here for unit testing for KMM project? • Plain kotlin test doesn't have strong assertion support • Kotest doesn't have an assertion library for native so it doesn't work with KMM • Atrium, not supported for Native I am targeting iOS & Android only. Most of my code is in commonMain and I plan to do tests in commonTest. Any suggestion on the library would be helpful.
r
please up-vote https://github.com/robstoll/atrium/issues/450 or even consider to become a sponsor, would motivate me to deliver also for native 🙂
s
I've never found the assertion support in plain Kotlin test to be that bad, it's not as fully featured as junit but it does the job
n
What do you mean about Kotest ? I have used Kotest Assertions in a multiplatform project targeting iOS and Android 🤔
j
I ran across this library inspired by Google Truth, but haven't used it. https://github.com/varabyte/truthish I personally haven't had a problem using kotlin-test, plus writing occasional helper functions if I run into a corner case it doesn't support.
Here's another assertion library to check out: https://github.com/willowtreeapps/assertk