CtrlK
BlogDocsLog inGet started
Tessl Logo

testland/kotest-tests

Configures and runs Kotest - Kotlin-native test framework with multiple specification styles (StringSpec, FunSpec, BehaviorSpec, DescribeSpec, ShouldSpec, FreeSpec, FeatureSpec, ExpectSpec, AnnotationSpec); rich matcher library; built-in property-based testing (alternative to jqwik); coroutines support; data-driven testing; isolation modes per-spec or per-test; integrates with Gradle JVM test task. Use when working with Kotlin and wanting Kotlin-idiomatic DSL over JUnit 5's annotation-driven approach. Matchers (shouldBe, shouldContain) are bundled with the runner and are not a drop-in replacement for a standalone JVM assertion library; for assertion-only use paired with JUnit 5 / TestNG / Spock see assertj.

80

Quality

100%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

Overview
Quality
Evals
Security
Files

matchers-and-isolation.mdreferences/

Kotest - matchers and isolation modes

Matchers

Per kotest.io/docs/assertions/matchers.html:

Core matchers:

MatcherUse
value shouldBe expectedEquality
value shouldNotBe expectedInequality
value should be(expected)Same; alternate syntax
value.shouldBeNull() / shouldNotBeNull()Null check
string.shouldContain("substring")String membership
string.shouldStartWith("prefix") / shouldEndWith("suffix")String pos
string.shouldMatch(regex)Regex
list.shouldHaveSize(3) / shouldContainExactly(...) / shouldContainAll(...)Collection
map.shouldContainKey("key") / shouldContainValue("v")Map
value.shouldBeInstanceOf<MyClass>()Type
result.shouldBeSuccess() / shouldBeFailure()Kotlin Result
shouldThrow<E> { ... }Exception

Isolation modes

Per kotest.io/docs/framework/isolation-mode.html:

Four modes (default SingleInstance):

ModeBehavior
SingleInstanceOne spec instance for all tests (default; fastest)
InstancePerTestFresh spec instance per test (incl. nested contexts)
InstancePerLeafFresh spec instance per leaf-test only

Set per-spec:

class StatefulTest : StringSpec({
    isolationMode = IsolationMode.InstancePerTest
    // ...
})

Or globally via AbstractProjectConfig.

SKILL.md

tile.json