Shervin
02/17/2025, 10:57 AMdirk.dittert
02/17/2025, 2:27 PMval data = readSomeData() // reads a file from /src/test/resources
val actual = mangle(data)
actual shouldBe """
line 1
line 2
""".trimIndent()
The problem is that line separators can be different between the file and Kotlin multiline strings. How to deal with that in the most convenient way possible?dirk.dittert
02/19/2025, 10:10 AMShervin
02/19/2025, 12:31 PMabendt
02/20/2025, 5:05 PMJustin Tullgren
02/25/2025, 12:40 PMandroidUnitTest
source folder. Set up described here https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-run-tests.html#for-android. Right now kotest doesn’t notice those tests when it does a scan so no tests are run but it does pick up the commonTest specs.Klitos Kyriacou
02/25/2025, 4:26 PMcontentEquals
)?Kirill Zhukov
03/14/2025, 7:07 PMasClue
and withClue
but I'm not seeing the clue included in a stacktrace 🧵huehnerlady
03/21/2025, 5:46 AMorg.jetbrains.kotlin.analysis.api.impl.base.sessions.ProhibitedAnalysisException: Analysis is not allowed: Called in the EDT thread.
at org.jetbrains.kotlin.analysis.api.impl.base.sessions.KaBaseSessionProvider.beforeEnteringAnalysis(KaBaseSessionProvider.kt:54)
at org.jetbrains.kotlin.analysis.api.impl.base.sessions.KaBaseSessionProvider.beforeEnteringAnalysis(KaBaseSessionProvider.kt:45)
at io.kotest.plugin.intellij.psi.SuperClassesKt.getAllSuperClasses(superClasses.kt:48)
at io.kotest.plugin.intellij.psi.SpecsKt.specStyle(specs.kt:52)
at io.kotest.plugin.intellij.psi.SpecsKt.isSpec(specs.kt:31)
at io.kotest.plugin.intellij.psi.SpecsKt.isContainedInSpec(specs.kt:76)
at io.kotest.plugin.intellij.KotestTestFinder.isTest(KotestTestFinder.kt:45)
at com.intellij.testIntegration.TestFinderHelper.isTest(TestFinderHelper.java:48)
at com.intellij.testIntegration.GotoTestOrCodeHandler.getSourceAndTargetElements(GotoTestOrCodeHandler.java:50)
at com.intellij.codeInsight.navigation.GotoTargetHandler.invoke(GotoTargetHandler.java:72)
at com.intellij.codeInsight.actions.CodeInsightAction.lambda$actionPerformedImpl$0(CodeInsightAction.java:73)
at com.intellij.codeInsight.actions.CodeInsightAction.lambda$actionPerformedImpl$1(CodeInsightAction.java:79)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:226)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:159)
at com.intellij.codeInsight.actions.CodeInsightAction.actionPerformedImpl(CodeInsightAction.java:70)
at com.intellij.codeInsight.actions.CodeInsightAction.actionPerformed(CodeInsightAction.java:41)
at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.kt:345)
at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:32)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$actionProcessor$1.performAction(IdeKeyEventDispatcher.kt:496)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4$lambda$3(IdeKeyEventDispatcher.kt:845)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$4(IdeKeyEventDispatcher.kt:845)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1164)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.kt:362)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:843)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.access$doPerformActionInner(IdeKeyEventDispatcher.kt:1)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction$intellij_platform_ide_impl(IdeKeyEventDispatcher.kt:572)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:509)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:448)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:441)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:303)
at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:620)
at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$15(IdeEventQueue.kt:582)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:582)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:73)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:357)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:356)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:356)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:351)
at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke$lambda$0(IdeEventQueue.kt:1035)
at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910)
at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1036)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1036)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$10(IdeEventQueue.kt:351)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:397)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
I currently use intellij 2024.2.5 where it work last.
I also tried uninstall and reinstall the plugin, but that doesn't help
Currently I installed the latest version - 1.3.92-2024.2.2
Anything what I can try?phldavies
03/21/2025, 3:29 PMRob Elliot
03/28/2025, 3:54 PMimport io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe
@Suppress("UNCHECKED_CAST")
abstract class AbstractSpec(
body: AbstractSpec.() -> Unit,
) : StringSpec(body as StringSpec.() -> Unit) {
fun shared() { }
val sharedProperty = "foo"
}
class ConcreteSpec : AbstractSpec({
"some test" {
shared()
sharedProperty shouldBe "foo"
}
})
That unchecked cast bothers me, and suggests to me that there is probably a better way... could someone point me at the docs I've missed?Sergi Aguilar
03/31/2025, 8:52 AMsam
03/31/2025, 7:58 PMEmre
03/31/2025, 9:44 PMdirk.dittert
04/01/2025, 1:36 PMval subject = intArrayOf()
val expected = intArrayOf()
subject shouldBeEqual expected
This fails because what I really intended to do was to use contentEquals()
on the arrays. I don't seem to find a matcher to do just that, though?dirk.dittert
04/01/2025, 2:01 PM[0.631s][error][attach] failure (232) writing result of operation jcmd to pipe \\.\pipe\javatool-558031551
Is this caused by KoTest?wellingtoncosta
04/01/2025, 4:33 PMcheck
task or by hitting the play button.
// libs.versions.toml
kotest = [
"kotest-framework-engine",
"kotest-assertions",
"kotest-property",
]
// build.gradle.kts
commonTest {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation(libs.kotlinx.coroutines.test)
implementation(libs.bundles.kotest)
implementation(libs.koin.test)
implementation(libs.turbine)
}
}
// in commonTest source set
class KotestSampleTest : BehaviorSpec() {
init {
Given("2 + 2") {
Then("it must be 4") {
2 + 2 shouldBeEqual 4
}
}
}
}
Tasuku Nakagawa
04/02/2025, 7:03 AMInstancePerLeaf
on Kotest 6.0.0 (M3).
i want to instantiate test cases for each it
blocks of DescribeSpec
dirk.dittert
04/04/2025, 1:39 PMSomeModelSpeckt:150
when there are only 120 lines in that file. That only seems to happen when I use assertSoftly
. Does anyone know what is going on here?Fergus Hewson
04/10/2025, 7:32 PMUnable to find overload of function io.kotest.matchers.shouldBe for power-assert transformation callable as:
- io.kotest.matchers.shouldBe(String)
- io.kotest.matchers.shouldBe(() -> String)
- io.kotest.matchers.shouldBe(U of io.kotest.matchers.shouldBe?, String)
- io.kotest.matchers.shouldBe(U of io.kotest.matchers.shouldBe?, () -> String)
Kotest "6.0.0.M3"
Kotlin "2.1.20"
Any ideas?Matteo Mirk
04/15/2025, 7:51 AMGiorgio Vespucci
04/17/2025, 10:36 AMIDEA 2025.1
?
My Kotest Plugin 1.3.92-2024.3.1
is preventing me from navigating to tests by using Navigate -> Test
.
See the attached screenshot.Giorgio Vespucci
04/18/2025, 12:31 PMdebug
level of logging to see what "it's doing"?
I'm affected in my work project by a behavior that HANGS A LOT before starting to execute the tests.
I cannot upgrade from V5.6.x to v5.9.x due to this.
I only see an infinite series of
Warning: Kotest autoscan is enabled. This means Kotest will scan the classpath for extensions that are annotated with @AutoScan. To avoid this startup cost, disable autoscan by setting the system property 'kotest.framework.classpath.scanning.autoscan.disable=true'. In 6.0 this value will default to true. For further details see <https://kotest.io/docs/next/framework/project-config.html#runtime-detection>
Setting the mentioned property to true
doesn't help.
Thank You
CC @Matteo MirkSebastian Schuberth
04/24/2025, 1:29 PMphldavies
04/24/2025, 2:57 PMMarkRS
04/30/2025, 8:26 AMJames Eschner
05/05/2025, 5:54 PMBenoît Liessens
05/07/2025, 7:03 AMwithEnvironment
. Is there a replacement?
ThanksBernd Prünster
05/08/2025, 5:40 PM