Jump to content

Draft:Kotest

From Wikipedia, the free encyclopedia

Kotest
Developer(s)Kotest framework organization
Stable release
5.9.1 / June 6, 2024; 13 months ago (2024-06-06)[1]
Repositorygithub.com/kotest/kotest
Written inKotlin
TypeTest framework
LicenseApache 2.0
Websitekotest.io

Kotest is a test automation framework for the Kotlin programming language. Kotest is used for unit testing, and is one of the xUnit frameworks.

Kotest is linked as a JAR at compile-time. The latest version of the framework, Kotest 5, resides under the Maven group name io.kotest.

Example of a Kotest spec

[edit]

A Kotest test fixture, which is referred to as a Spec in Kotest, is a Kotlin class. Test cases are created as functions inside the class. If the situation requires it,[2] it is also possible to define lifecycle callbacks to execute functions before or after each (or all) of the test cases.

import io.kotest.core.spec.style.FunSpec

class MyTests : FunSpec({
    test("String length should return the length of the string") {
        "sammy".length shouldBe 5
        "".length shouldBe 0
    }
})

Community

[edit]

An official #kotest channel is available in the KotlinLang Slack workspace, which can be joined via the Kotlin community page.[3]

Technology Radar

[edit]

Kotest has featured in multiple editions of the bi‑annual Thoughtworks Technology Radar. It first appeared in Volume 21 (November 2019) in the Assess ring, was promoted to the Trial ring in Volume 26 (March 2022), and reached the Adopt ring in Volume 27 (October 2022). The Radar highlights Kotest’s variety of testing styles, extensive matcher library, support for property‑based testing and its IntelliJ IDEA plug‑in as key reasons for adoption.[4]

See also

[edit]
  • JUnit, unit testing framework for the Java programming language
  • Mockito, mocking extensions to JUnit
  • TestNG, test framework for Java

References

[edit]
  1. ^ "Release Notes". kotest.io. Retrieved 29 July 2025.
  2. ^ Kent Beck. "Expensive Setup Smell". C2 Wiki. Retrieved 29 July 2025.
  3. ^ "Kotlin Community Slack". kotlinlang.org. Retrieved 29 July 2025.
  4. ^ "Kotest - Technology Radar entry". Thoughtworks Technology Radar. Thoughtworks. 26 October 2022. Retrieved 29 July 2025.
[edit]