Run tests with Kotlin Multiplatform
By default, Kotlin supports running tests for JVM, JS, Android, Linux, Windows, macOS as well as iOS, watchOS, and tvOS simulators. To run tests for other Kotlin/Native targets, you need to configure them manually in an appropriate environment, emulator, or test framework.
If you didn't use the Project Wizard to create your project, you can add the dependencies manually.
Run tests for one or more targets
To run tests for all targets, run the
To run tests for a particular target suitable for testing, run a test task
Test shared code
For testing shared code, you can use actual declarations in your tests.
For example, to test the shared code in
You can use the following test in
And the following test in
You can also learn how to create and run multiplatform tests in the Create and publish a multiplatform library – tutorial.