Kotlin Tests

Open-source Kotlin projects categorized as Tests

Top 23 Kotlin Test Projects

  • mockk

    mocking library for Kotlin

  • Project mention: For those DAO, Services, how about using static objects with mockk for test | /r/u_Fun_Indication4997 | 2023-12-08

    The official suggests using dagger/hilt to inject them. However, they could be static based on the static ApplicationContext. Although Dagger/hilt aids in unit testing, mockk can accomplish this easily as well by modifying bytecode during run time. As for the stability, `mockk` has 5000+ stars on GitHub and keeps renewing.

  • Kotest

    Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing

  • Project mention: AocKt: Test-driven Advent of Code in Kotlin | /r/Kotlin | 2023-11-29

    As you might know, Advent of Code will begin this Friday! If, like me, you want to have a go at solving the puzzles in Kotlin, I would like to share with you a little library I've developed to reduce boilerplate and solve the puzzles in a test-driven approach. It is based on Kotest, a modern and Kotlin-first test framework.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • mockito-kotlin

    Using Mockito with Kotlin

  • Project mention: Best practices for Unit Testing Android Apps with Mockk, Kotest and others | dev.to | 2023-05-10

    As you can see, I create mockUsersRepository object using mock( function. Then, in setup() method, I set up this repository in such a way so that it would return a list of hardcoded values. After this, on top of everything else, I check if, for mockUsersRepository object, getUsers method was called with verify function, in the test method. It’s important to note that Mockito is a very old framework and was originally written for Java. When Kotlin appeared, it turned out that out of the box this framework can work with some limitations, which is why an extension, mockito-kotlin, was released. The example above was written with it. Another Mockito’s limitation was that it was impossible to mock final classes and static methods, and all classes are final by default in Kotlin. Currently, this is solved through mockito-inline but, before, it was a serious limitation. In respect to Java development, there was and is an alternative for Android developers, PowerMock.

  • spek

    A specification framework for Kotlin

  • Project mention: Evolution of unit tests in Android | dev.to | 2023-10-22

    Spek is a unit testing framework for Kotlin which supports Specification and Gherkin style.

  • Kluent

    Fluent Assertion-Library for Kotlin

  • atrium

    A multiplatform expectation library for Kotlin

  • fakeit

    The Kotlin fake data generator library! (by thisisqubika)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • strikt

    An assertion library for Kotlin

  • kotlin-faker

    Port of a popular ruby faker gem written in kotlin. Generate realistically looking fake data such as names, addresses, banking details, and many more, that can be used for testing and data anonymization purposes.

  • prognoza

    Libre weather app with widgets and offline support

  • Project mention: Best Weather App That Doesn't Use Google Play Services | /r/GrapheneOS | 2023-07-05

    I personally use Prognoza, and can recommend it: https://github.com/davidtakac/prognoza

  • hamkrest

    Hamcrest for Kotlin

  • hikaku

    A library that tests if the implementation of a REST-API meets its specification.

  • expekt

    BDD assertion library for Kotlin

  • KotlinSnapshot

    Snapshot Testing framework for Kotlin.

  • minutest

    Simple, Expressive, Extensible Testing for Kotlin on the JVM

  • Elmyr

    A utility to make Kotlin/Java tests random yet reproducible

  • balin

    Balin is an automation library for Kotlin. It's basically a Selenium-WebDriver wrapper inspired by Geb.

  • kompile-testing

    Testing tools for kotlinc and kapt

  • SeleniumBuilder

    Kotlin DSL for Selenium. Provide a possibility to write tests in Kotlin type-safe builders style

  • Project mention: SeleniumBuilder | /r/Kotlin | 2023-11-02
  • TestIt

    Generate unit testing boilerplate from kotlin files.

  • arbitrater

    Arbitrater is a Kotlin library for creating arbitrary instances of classes by reflection for use in testing. In contrast to POJO generators, it supports Kotlin's optional parameters and nullable types.

  • RandomGenKt

    Kotlin port of RandomGen

  • selfie

    Snapshot testing for Java, Kotlin, and the JVM (by diffplug)

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Kotlin Tests related posts

Index

What are some of the best open-source Test projects in Kotlin? This list will help you:

Project Stars
1 mockk 5,280
2 Kotest 4,282
3 mockito-kotlin 3,071
4 spek 2,223
5 Kluent 862
6 atrium 537
7 fakeit 530
8 strikt 528
9 kotlin-faker 426
10 prognoza 360
11 hamkrest 341
12 hikaku 195
13 expekt 172
14 KotlinSnapshot 164
15 minutest 103
16 Elmyr 81
17 balin 72
18 kompile-testing 70
19 SeleniumBuilder 54
20 TestIt 43
21 arbitrater 40
22 RandomGenKt 35
23 selfie 31

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com