Project-wide configuration. Extensions returned by an
instance of this class will be applied to all Spec and TestCases.
AssertionMode is used to detect and warn a developer that a test does not execute any assertions.
It is usually the case that if a test function does not execute some kind of assertion then the test
is probably erroneous (see note). It is common to see junior developers write a test that does not actually test
anything.
Implementation of TimeoutExecutionContext to be used in environments which do not provide
the ability to spawn threads, such as Javascript. All executions occur on the same thread
as the caller. This means we cannot detect a deadlock in a test as we can
on the JVM by running the test in a seperate thread.
Defines the DSL for creating tests in the 'FunSpec' style
The description gives the full path to a TestCase.
Scans for tests as specified by a DiscoveryRequest.
DiscoveryExtension afterScan functions are applied after the scan is complete to
optionally filter the returned classes.
Allows interception of the discovery phase of Kotest.
DiscoveryRequest describes how to discover test classes.
Contains Spec classes discovered as part of a discovery request scan.
A DynamicTest is an intermediate test state held by a factory. Once the factory is added to a
Spec and the spec is created, the factories dynamic tests will be added to the spec
as fully fledged TestCases.
What is an extension? - An extension allows your code to interact
with the Kotest Engine, changing the behavior of the engine
at runtime.
An implementation of SpecExecutionOrder which will run specs that
contained a failed test on a previous run first, before specs where
all the tests passed.
Defines the DSL for creating tests in the 'FunSpec' style
Attach tag to io.kotest.core.spec.Spec, and that spec won't be instantiated or executed.
Implementation of SpecRunner that executes each TestCase in a fresh instance
of the Spec class.
The annotation JsTest is intercepted by the kotlin.js framework adapter to generate tests.
It is simply an alias to kotlin.test.Test on the JS target.
(extensions in package io.kotest.core.spec)
(extensions in package io.kotest.core.spec.style)
(extensions in package io.kotest.core.spec.style)
Kotest adapter for kotlin js test support.
An implementation of SpecExecutionOrder which will run specs in
a lexicographic order.
(extensions in package io.kotest.core.runtime)
(extensions in package io.kotest.core.spec)
A central store of project wide configuration. This configuration contains defaults for kotest, and is
supplemented by user configuration (if present) as loaded by detectConfig.
Contains all the configuration details that can be set by a user supplied config object.
Reusable extension to be registered with project config or auto scanned via @autoscan.
An implementation of SpecExecutionOrder which will run specs in
a different random order each time the are executed.
Allows including/excluding tags at runtime
Example:
Implementation of SpecRunner that executes all tests against the
same Spec instance. In other words, only a single instance of the spec class
is instantiated for all the test cases.
Contains methods which can be overriden to set config in the same way that KotlinTest 3.x allowed.
The preferred style is to call the DSL functions from within the tests but these methods are still
supported and will not be deprecated.
Note: This has no effect on non-JVM targets.
Handles the execution of a single Spec class.
Delegates to a SpecRunner which determines how and when
to instantiate fresh specs based on the IsolationMode of the spec.
Reusable spec extension that allows intercepting specs before they are executed.
The callback is invoked for each Spec that has been submitted for execution.
The base class for executing all the tests inside a Spec.
Defines the DSL for creating tests in the 'StringSpec' style.
Decorates a TestFactoryConfiguration with the StringSpec DSL.
This TagExtension includes and excludes tags using the system properties
'kotest.tags.include' and 'kotest.tags.exclude'.
Base class for all tags. The simple name (without packages) of the singleton derived from this
class will be used as name. Two tag object with the same simple name (same object names in
different packages) are treated as a single tag.
Returns Tags to be used by the Test Engine in determining active tests.
Allows include / exclude Spec with Tags annotation.
Attach tag to io.kotest.core.spec.Spec, excluded spec won't be initiated.
A TestCase describes an actual block of code that will be tested.
It contains a reference back to the Spec instance in which it
is being executed.
Reusable extension that intercepts calls to a TestCase.
A TestCaseFilter can be used to filter tests before they are executed.
They are passed to KotestEngine at runtime.
This enum is used to configure the order of root test execution in a Spec.
The parent of all configuration DSL objects and contains configuration methods
common to both Spec and TestFactoryConfiguration implementations.
A TestContext is used as the receiver of a closure that is associated with a TestCase.
Implementations of this interface will be notified of events
that occur as part of the KotestEngine lifecycle.
Executes a single TestCase. Uses a TestExecutionListener to notify callers of events in the test.
A TestFactory is a generator of tests along with optional configuration and
callbacks related to those tests. A test factory can be added to a Spec and the
tests generated by the factory will be included in that spec.
A TestFactoryConfiguration provides a DSL to allow for easy creation of a
TestFactory when this class is the receiver of a lambda parameter.
(extensions in package io.kotest.core.internal)
Allows for the execution of a function with a timeout to wake blocked threads.
Defines the DSL for creating tests in the 'WordSpec' style.
Decorates a TestFactoryConfiguration with the WordSpec DSL.