BaseTest

interface BaseTest : HasTestEnvironmentFactory<DefaultTestEnvironment.Factory> , TrimmedAsserts(source)

Properties

Link copied to clipboard
open override val testEnvironmentFactory: DefaultTestEnvironment.Factory

Functions

Link copied to clipboard
open infix fun <T, U : T> T.shouldBe(expected: U?)

Delegates to Kotest's shouldBe, but removes all the noise at the beginning of a stacktrace, like:

open infix fun String.shouldBe(expected: String)

A special String-only version of shouldBe which calls trimIndent first.

open infix fun Sequence<*>.shouldBe(expected: List<*>)

Treat sequences like lists when asserting.

Link copied to clipboard
open infix fun String.shouldBeNoTrimIndent(expected: String)

An alternative to the overloaded String-only shouldBe, since the overloaded version automatically applies trimIndent.

Link copied to clipboard
open infix fun File.shouldHaveText(expected: String)

reads the file's text and asserts

Link copied to clipboard
open fun <ENV : TestEnvironment> HasTestEnvironmentFactory<NoParamTestEnvironmentFactory<ENV>>.test(names: List<String>, testLocation: TestLocation, testAction: suspend ENV.() -> Unit)
open fun <ENV : TestEnvironment> test(testEnvironmentFactory: NoParamTestEnvironmentFactory<ENV>, names: List<String>, testLocation: TestLocation, testAction: suspend ENV.() -> Unit)
open fun <PARAM, ENV : TestEnvironment> HasTestEnvironmentFactory<ParamTestEnvironmentFactory<PARAM, ENV>>.test(param: PARAM, names: List<String>, testLocation: TestLocation, testAction: suspend ENV.() -> Unit)
open fun <PARAM, ENV : TestEnvironment> test(param: PARAM, testEnvironmentFactory: TestEnvironmentFactory<PARAM, ENV>, names: List<String>, testLocation: TestLocation, testAction: suspend ENV.() -> Unit)

open fun test(testLocation: TestLocation = TestLocation.get(), testAction: suspend TestEnvironment.() -> Unit)

shorthand for executing a test in a hermetic TestEnvironment but without any kase parameters

Link copied to clipboard
open fun <T, U : T> T.trimmedShouldBe(expected: U?, vararg excludeFromStack: KClass<*>)

Delegates to Kotest's shouldBe, but removes all the noise at the beginning of a stacktrace, like: