Kommons Debug — Logo

Kommons Download from Maven Central Download from GitHub Packages Build Status Repository Size Repository Size

About

Kommons Test is a Kotlin Multiplatform Library to ease testing.

This library is based on Kotest Assertions.

It provides you with a small number of helper functions to help you write most tests as common Kotlin tests.

Why? Because every common test you write saves you from having to write it for each supported platform separately.

Installation / Setup

Kommons Debug is hosted on GitHub with releases provided on Maven Central.

  • Gradle testImplementation("com.bkahlert.kommons:kommons-test:0.1.0")

  • Gradle implementation("com.bkahlert.kommons:kommons-test:0.1.0") (for MPP projects)

  • Maven

    <dependency>
        <groupId>com.bkahlert.kommons</groupId>
        <artifactId>kommons-test</artifactId>
        <version>0.1.0</version>
        <scope>test</scope>
    </dependency>

Features

tests

Write a bunch of tests conveniently in a single test:

@Test fun test_contain() = tests {
    "foo bar" shouldContain "Foo"
    "foo bar" shouldContain "foo"
    "foo bar" shouldContain "baz"
}

The above tests has three assertions of which the first and last fail when run with the following output:

The following 2 assertions failed:
1) "foo bar" should include substring "Foo"
    at sample.Tests.test_contain(Tests.kt:1)
2) "foo bar" should include substring "baz"
    at sample.Tests.test_contain(Tests.kt:3)

Contributing

Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. You can also support this project by making a PayPal donation to ensure this journey continues indefinitely!

Thanks again for your support, it is much appreciated! 🙏

License

MIT. See LICENSE for more details.

GitHub

View Github