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.
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
Nicolas Picon
05/22/2023, 7:19 PM
What do you mean about Kotest ? I have used Kotest Assertions in a multiplatform project targeting iOS and Android 🤔
j
Jeff Lockhart
05/23/2023, 12:04 AM
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.