kotest / kotest-intellij-plugin

The official Kotest plugin for Intellij and Android Studio
Apache License 2.0
179 stars 25 forks source link

KoTest run configuration does not have options to run test repeatedly #304

Open bliessens opened 4 months ago

bliessens commented 4 months ago

The JUnit run configuration has options to run a test repeatedly: given number of executions, until failure, ...

image

KoTest run configuration do not have this option.

Kantis commented 4 months ago

You can easily configure the test itself to repeat N times.

bliessens commented 4 months ago

I found this deprecated method but it doesn't seem to work:

override fun defaultTestCaseConfig(): TestCaseConfig? = TestCaseConfig(invocations = 1_000)
Kantis commented 4 months ago

Do you want to do it for all tests, or a particular test?

For a particular test, you add .config(invocations = N) to the test itself. Like:

      "Value provided (cents) should be converted to whole SEK".config(invocations = 100) {
         Amount(100, 25).vatAmount shouldBe BigDecimal.valueOf(0.25)
      }