A multiplatform expectation library for Kotlin with fluent APIs, extensible design, and detailed failure reporting.
Atrium is a multiplatform expectation library for Kotlin that provides a fluent API for writing assertions in tests. It helps developers write expressive and readable test expectations with detailed failure messages, making it easier to understand why a test failed. The library supports JVM, JS, and Android, and is designed to be extensible, allowing customizations and integrations.
Kotlin developers writing tests for multiplatform projects (JVM, JS, Android) who want expressive assertion syntax and clear failure reporting. It's especially useful for teams adopting Kotlin for cross-platform development.
Developers choose Atrium for its detailed failure messages, multiplatform support, and extensible design. Unlike other assertion libraries, it offers both fluent and infix APIs, sophisticated collection expectations, and the ability to customize or extend core functionality.
A multiplatform expectation library for Kotlin
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works on JVM, JS, and Android with a single codebase, enabling consistent testing across platforms, as stated in the GitHub description and installation guide.
Provides structured error messages that show the subject, expected values, and mismatches explicitly, making debugging easier, demonstrated throughout the README examples.
Allows adding custom expectation functions or replacing core components, offering flexibility for advanced use cases, per the project's philosophy and extensibility sections.
Includes builders for complex containment checks with options like inOrder and inAnyOrder, enabling detailed collection assertions, as shown in the collection expectations examples.
The fluent API and builder patterns, while expressive, require significant time to master and can overwhelm new users, evident from the extensive documentation and multiple API styles.
Requires Kotlin 1.4+ and drops support for legacy JS backends, potentially blocking adoption in projects with older toolchains, as noted in the installation requirements.
Users may encounter Kotlin bugs causing ambiguous overloads when using feature extraction with reflection, admitted in the FAQ under 'ambiguity problems', leading to compile-time errors.
Atrium is an open-source alternative to the following products: