Kotlin Multiplatform Development
 

Test your multiplatform app − tutorial

Edit pageLast modified: 25 September 2024

In this tutorial, you'll learn how to create, configure, and run tests in Kotlin Multiplatform applications.

Tests for multiplatform projects can be divided into two categories:

  • Tests for common code. These tests can be run on any platform using any supported framework.

  • Tests for platform-specific code. These are essential to test platform-specific logic. They use a platform-specific framework and can benefit from its additional features, such as a richer API and a wider range of assertions.

Both categories are supported in multiplatform projects. This tutorial will first show you how to set up, create, and run unit tests for common code in a simple Kotlin Multiplatform project. Then, you'll work with a more complex example that requires tests both for common and platform-specific code.