The test framework is abstracted through the class. A basic Asserter implementation is provided out of the box. Note that the class is not intended to be used directly from tests, use instead the top-level assertion functions which delegate to the Asserter.

    The library consists of the modules:

    • kotlin-test-common – assertions for use in common code;
    • kotlin-test – a JVM implementation of assertions from kotlin-test-common;
    • kotlin-test-junit – provides an implementation of Asserter on top of JUnit and maps the test annotations from to JUnit test annotations;
    • kotlin-test-junit5 – provides an implementation of on top of JUnit 5 and maps the test annotations from kotlin-test-annotations-common to JUnit 5 test annotations;
    • kotlin-test-js – a JS implementation of common test assertions and annotations with the out-of-the-box support for Jasmine, , and Jest testing frameworks, and an experimental way to plug in a custom unit testing framework.

    Common

    JVM

    JUnit

    TestNG

    JS

    Native

    1.0

    Annotations to mark test functions and top-level functions for performing assertions in tests.

    1.0

    kotlin.test.junit

    JUnit5

    1.0

    TestNG

    1.0

    kotlin.test.testng

    Index