Questions tagged [kotest]

For questions related to the Kotlin testing framework 'Kotest', which was formerly known as Kotlintest.

Kotest is an open-source testing framework for Kotlin: https://github.com/kotest/kotest/

107 questions
1
vote
1 answer

How to target js with kotlin kotest?

I have been trying to setup kotest in a kotlin multiplatform project. On the kotest starting guide it says to add this dependency to commonTest implementation 'io.kotest:kotest-framework-engine:$version' Unfortunately this does not resolve Could…
Andrew
  • 1,109
  • 1
  • 15
  • 27
1
vote
1 answer

Easy way of running the same kotest test over and over?

What is the easiest way to run the same test and the same suite or class n times in a row using kotest framework?
1
vote
1 answer

using kotest FreeSpec on multiplatform module

I looks like there's no native module with io.kotest.core.spec.style.FreeSpec, or am I missing something?
Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
1
vote
2 answers

Why is a standard iterator faster than sequence in Kotlin?

I am new to sequences, so I may have done something (more or less) terribly wrong, but I have a questiion: I have written two functions: fun isPrimeNumber1(number: Int): Boolean { if (number <= 1) return false for (divider in 2 .. number /…
hc0re
  • 1,806
  • 2
  • 26
  • 61
1
vote
0 answers

Wiremock using certificate not working on Windows

This error only happens on the Windows OS. On Linux and MacOS it works fine. I've made sure that the password for the certificates is correct, that they do exist in the mentioned location and that the port is available. Language is Kotlin. Testing…
SasaFajkovic
  • 395
  • 1
  • 4
  • 16
1
vote
1 answer

Could not resolve io.kotest:kotest-runner-junit5-jvm:4.1.1 in kotlin multiplatform module

I have a project with multiple modules. One of the modules is kotlin multiplatform. I'm trying to add unit tests for it using Kotest 4.1.1. This release is published in repository mavenCentral(), and I can use this release just fine in a module…
SKOlson
  • 367
  • 2
  • 13
1
vote
3 answers

How do I install the Kotest plugin for intellij from a github repository?

I have this repo but don't know how to actually use it. Only did a git clone but what is next? https://github.com/kotest/kotest-intellij-plugin
Dawn
  • 49
  • 5
1
vote
0 answers

Create Global DB Schema for Kotlin Test Cases with Exposed Framework

I am new to Kotlin-Exposed Framework. What I am looking for is to have a Global DB schema in H2 Database - jdbc:h2:mem:test for my test cases. In my application, I am using mysql. I want to use H2 only for testing. Below is my code snippet for…
RKP
  • 750
  • 2
  • 12
  • 23
1
vote
2 answers

Setting tags at the class level or container level

Using .config we can group tests by tags as explained here: link Example: class MyTest : StringSpec({ "should run on Windows".config(tags = setOf(Windows)) { // ... } }) As far as I can tell it is not possible to set tags at a higher level,…
ZeitPolizei
  • 481
  • 1
  • 4
  • 10
1
vote
0 answers

Kotest freezes after migrating to 4.0.0-BETA1 on testDebugUnitTest task

I have replaced old io.kotlintest with new io.kotest dependency and imported it to all the tests. They pass when are run individually, but gradle task gradlew test freezes on testDebugUnitTest task. > Task :myAppModule:testDebugUnitTest Gradle Test…
Angelina
  • 11
  • 3
0
votes
0 answers

Spring Boot - Kotest Failed to load ApplicationContext

I'm trying to integrate Kotest with Spring Boot (I'm a beginner, so don't judge me harshly) Here is my spring boot test class @SpringBootTest class ApiAutomationApplicationTests Another Test class @ContextConfiguration(classes = [A::class]) class…
0
votes
0 answers

I don't know if MockMvc is not autowired when writing test code using spring rest docs

I tried to write a test code using 'rest docs' in Spring Boot with kotlin. I am having an issue with injecting MockMvc to my test class. No qualifying bean of type Shouldn't @AutoConfigureMockMvc, @AutoConfigureRestDoc,…
0
votes
0 answers

How to test an Auth0 JWT authenticated API endpoint in Kotlin Ktor

Authentication with Auth0 is working on development but my tests are all failing with a 401 now. I have tried to mock it but get the provided error below. I feel like this is a very common problem that any tested API application would have to…
joeyk16
  • 1,357
  • 22
  • 49
0
votes
1 answer

How can I use Either.shouldBeRight matcher in recent versions of kotest?

I have a project using kotest-assertions-arrow v1.0.3. I have a code using shouldBeRight: obj.shouldBeRight { value -> assertThat(value.blahblahblah, equalTo(xyz)) } shouldBeRight is marked as deprecated in that version so I am…
Sixro
  • 402
  • 4
  • 16
0
votes
2 answers

Format Kotlin with minimal indent for code blocks in constructor parameters, like Foo({ bar })

When formatting this code block (from the Kotest documentation), Jetbrains Intellij or Android Studio adds a lot of unnecessary white space. Original code: class MyTests : FreeSpec({ "String.length" - { "should return the length of the…
HugoRune
  • 13,157
  • 7
  • 69
  • 144