SaaSHub helps you find the best software and product alternatives Learn more →
Top 23 Kotlin Test Projects
-
Kotest
Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing
-
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.
-
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.
-
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.
-
balin
Balin is an automation library for Kotlin. It's basically a Selenium-WebDriver wrapper inspired by Geb.
-
SeleniumBuilder
Kotlin DSL for Selenium. Provide a possibility to write tests in Kotlin type-safe builders style
-
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.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Project mention: For those DAO, Services, how about using static objects with mockk for test | /r/u_Fun_Indication4997 | 2023-12-08The 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.
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.
Project mention: Best practices for Unit Testing Android Apps with Mockk, Kotest and others | dev.to | 2023-05-10As 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 is a unit testing framework for Kotlin which supports Specification and Gherkin style.
Project mention: Best Weather App That Doesn't Use Google Play Services | /r/GrapheneOS | 2023-07-05I personally use Prognoza, and can recommend it: https://github.com/davidtakac/prognoza
Kotlin Tests related posts
- For those DAO, Services, how about using static objects with mockk for test
- AocKt: Test-driven Advent of Code in Kotlin
- Tests Everywhere - Kotlin
- SeleniumBuilder
- Evolution of unit tests in Android
- 🧪 **Demystifying Kotlin Unit Testing**: Your Odyssey to Code Confidence! 🚀
- Best practices for Unit Testing Android Apps with Mockk, Kotest and others
-
A note from our sponsor - SaaSHub
www.saashub.com | 26 Apr 2024
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