Home

strikt

Strikt is an open-source assertion library for Kotlin and Java that aims to make unit tests more readable and expressive. It provides a fluent domain-specific language (DSL) for writing assertions, with a focus on descriptive failure messages and ease of use for complex data structures.

The core concept in Strikt is to create an assertion context for a value (for example, expectThat(actual))

Design and philosophy emphasize precise failure reporting, showing where actual values diverge from expectations, and providing

Integration and ecosystem: Strikt works with popular JVM testing frameworks such as JUnit 4 and JUnit 5

History and community: Strikt is an open-source project developed by multiple contributors and maintained with documentation

and
then
apply
a
sequence
of
matchers
or
nested
assertions.
Common
capabilities
include
checking
for
nullity,
equality,
ordering,
size,
containment,
and
custom
predicates.
The
library
supports
chaining
and
nested
contexts
to
drill
into
properties
of
objects,
elements
of
collections,
and
entries
in
maps.
It
also
allows
developers
to
define
custom
assertions
tailored
to
their
domain
concepts.
clear
paths
to
debugging
information.
Strikt
emphasizes
immutability
and
thread-safety
of
its
assertion
components,
contributing
to
predictable
test
behavior.
and
can
be
used
in
both
Kotlin
and
Java
projects.
It
covers
assertions
on
primitive
values,
nullable
types,
collections,
and
complex
objects,
and
it
supports
extending
the
library
with
user-defined
assertions
and
matchers.
and
examples
available
on
its
official
site
and
GitHub
repository.
It
is
part
of
the
Kotlin
testing
tooling
landscape
and
is
positioned
as
an
alternative
to
other
JVM
assertion
libraries
that
offer
Kotlin-friendly
APIs.