Kotest Framework
An introduction to Kotlin testing frameworks.
An introduction to Kotlin testing frameworks.
This section explains various extension projects available for Kotest.
Explains assertions and matchers in Kotlin.
Explains Property Testing.
Introduces the Kotest IntelliJ Plugin.
Kotest property testing defines inputs and expected output, then generates many inputs that should satisfy the property being tested.
In tests, assertions are used to check whether specific conditions are true. In Kotlin, Kotest lets you use many kinds of assertions and matchers. This section looks at assertions and matchers in detail.
Kotest integrates with many other libraries and frameworks. Some are provided by the Kotest team, while others are maintained and hosted by third parties.
Introduces the Kotest IntelliJ Plugin.
An introduction to Kotlin’s testing framework.
Kotest provides a Spring extension that lets you test code that uses the Spring framework for dependency injection.
Introduces the Test Explorer in the Kotest IntelliJ Plugin.
Kotest has two function variants used to run property tests, forAll and checkAll.
Kotest is a powerful testing framework written in Kotlin. This page explains how to set up a project.
This page explains the Ktor extension.
Introduces how to configure properties in the Kotest IntelliJ Plugin.
Kotest generators are tools used to support property-based testing.
Explains basic Kotest test writing, test execution, and reports.
In Kotest, you can create custom matchers to check specific conditions.
Kotest System Extensions provide assertions for system calls related to Java’s java.lang.System class. These extensions are used to test exceptions from system calls and verify behavior such as system output or system exit.
Introduces the full list of Kotlin generators.
Kotest provides a variety of testing styles. This page explains the supported testing styles and how to use them.
Introduces Kotest generator operations including Next, Filter, Map, FlatMap, Merging, and Bind.
Testcontainers is a tool that lets you use container-based external resources during tests. It helps build a test environment similar to a real environment and makes testing external resources easier. This page explains how to use Testcontainers in Kotest.
In Kotest, clues let you provide detailed explanations for assertions.
There are several ways to disable tests. You can hard-code it in the test or disable tests conditionally at runtime.
Explains assertions for testing exceptions in Kotlin.
Kotest’s EmbeddedKafkaListener is an extension that lets you use Apache Kafka in embedded form in a test environment.
Isolation Modes control how the test engine creates spec instances for test cases. In other words, they determine how test instances are created for each test case.
When writing effective test code, it is important to manage the lifecycle of each test case. This page explains how to use lifecycle hooks.
MockServer provides a virtual HTTP server. With this library, you can test as if communicating with a real server without using a separate mocking library such as mockk.
When a property test runs, values are generated using a random source created from a seed value.
Soft assertions use assertSoftly to group and execute multiple assertions.
Explains Kotest property testing configuration.
Kotest can generate test reports in JUnit XML format. This format can be used in automated test execution environments such as CI/CD tools. JUnit XML reports record test execution results and are used to analyze them and generate statistics and quality metrics for test results.
In addition to matchers, Kotest supports inspectors, extension functions for collections that verify whether an assertion holds for a particular group of elements.
Kotest Extensions are extension features that provide various capabilities which can be integrated into the test lifecycle of the Kotest test execution framework.
Kotest provides an HTML Reporter that can generate test reports in HTML format. This lets you visually inspect test execution results and provides detailed information about test execution.
This page explains how to test coroutines in Kotest.
Assertion Mode controls what happens when a test runs without executing any assertions.
This page introduces the Allure extension.
In property-based testing, the first failure case found may contain a lot of complexity that is not actually responsible for making the test fail.
Introduces the types of Kotest core matchers.
This page explains exception testing in Kotest.
This page introduces the Current Instant Listeners extension.
Sometimes you may want to know what kinds of values Kotest generates to check that a generator is configured as expected.
Introduces rich matchers available for Collection, Iterable, and Array types.
For effective testing, creating, managing, and cleaning up test data is important. This section looks at how to manage test data with Kotest.
This page introduces the Kotest Koin extension.
Explains JSON matchers.
Some property test settings can be configured globally for all property tests.
Non-deterministic Testing can help verify software integrity. For example, it can effectively test software systems that include random or unpredictable elements such as parallel processes, external network calls, and access to various system resources.
This page introduces the WireMock extension.
Explains Ktor matchers.
Kotest provides an optional module that provides generators for Arrow.
You can write more robust, higher-quality tests by using Kotest together with the mocking framework mockk and JaCoCo. This page explains mockk, which helps with test isolation and dependency management, and JaCoCo, a code coverage tool that measures how much of a codebase is tested.
This page explains the Test Clock extension.
Explains Kotlinx Datetime matchers.
Kotest provides an optional module that provides generators for KotlinX DateTime.
Ordering in Kotest is a feature for controlling the order of test execution. It is useful when you want to run tests in a specific order or filter and run tests according to specific conditions.
This page introduces the Pitest extension.
Lists the current matchers in the Arrow matcher extension library.
Introduces additional Arbs for general-purpose data generation.
For effective software testing, writing and managing test cases is important. This section looks at how to write test cases with Kotest.
This page introduces the BlockHound extension.
When running tests on the JVM, Kotest supports automatically generating more complex Arbs.
This page explains how to automatically close resources in Kotest and how to temporarily create files and directories needed for tests.
Konform matchers can be used in tests to check whether a specified object passes or fails validation.
Kotest Configuration is used to customize and control test execution behavior. It provides many configuration options so users can adjust the test environment as needed.
Explains Klock matchers.
Sometimes you may want to write a common set of tests and reuse it for specific inputs. In Kotest, you can do this with test factories, which generate tests that can be included in one or more specs.
Explains compiler matchers.
This page explains how to output Kotest test results.
Explains Jsoup matchers.
This page explains how to test with invocation time limits.
This page explains how to fail fast in Kotest, how to fail on an empty test suite, and other settings.