BOESPJE5FTU Tests that will be run on both iOS and Android platform Tests that will be run only on iOS platform Tests that will be run only on Android platform
and property test library for Kotlin. 3rd Party Libraries for Testing Kotest 4USVDUVSFZPVSUFTUXJUI #FIBWJPS4QFD 4FUPGNBUDIFSTUP WBMJEBUFUFTUT 7BMVFHFOFSBUPSTGPS UFTUJOHFEHFDBTFTBOE SBOEPNWBMVFT
and property test library for Kotlin. 3rd Party Libraries for Testing Kotest 4USVDUVSFZPVSUFTUXJUI #FIBWJPS4QFD 4FUPGNBUDIFSTUP WBMJEBUFUFTUT 7BMVFHFOFSBUPSTGPS UFTUJOHFEHFDBTFTBOE SBOEPNWBMVFT
property test library // kmm-module/src/commonTest/kotlin/MyTest.kt class MyTest : BaseTest() { @Test fun `my coroutines test`() = runTest { checkAll( config = PropTestConfig(seed = 211125L), genA = Arb.int(-25..25), genB = Arb.int(-25..25), iterations = 100 ) { a, b -> mySum(a, b) shouldBe (a + b) } } } Generate random values from -25 to 25
MockK does not yet support Kotlin/Native 2. Testing with Coroutines • kotlinx-coroutines-test only supports Kotlin/JVM for now 3. Code coverage • Currently impossible to measure 4. Integration and E2E tests • Creates Fake implementation whose behavior can be overridden Issues with Testing in a KMM Project
project is difficult 2. Write automated test to ensure Business Logic is implemented correctly 3. Use 3rd party libraries to help write unit tests Summary