Is it expected for `AbstractProjectConfig` to be p...
# kotest
k
Is it expected for
AbstractProjectConfig
to be picked up by Kotest in a KMP project? It doesn’t seem to be working for me 🤔 https://github.com/kotest/kotest/issues/3462
e
the auto-detection depends on classpath scanning, so yes - it doesn't work on other targets
k
@Emil Kantis, do you mean it doesn’t work with non-jvm targets?
That would make sense
But I’ve seen this problem locally with
jvmTest
e
Graalvm?
k
amazon corretto
e
Odd.. it should definitely work for jvm targets (as far as I can tell).. if you can produce a MRE I'd be happy to take a look
k
Super weird, it’s working now 😑
Maybe I was missing gradle sync or something 😕
o
Actually, auto-detection works just fine on non-JVM targets: For K/Js and K/Native you have to add the Kotest Gradle plugin to the build. This will then activate a compiler plugin, which in turn picks up
AbstractProjectConfig
.
k
I’ve had the plugin applied the whole time actually! I think I’m getting tripped up by
isolationMode
. I had it set
InstancePerTest
in the global project config and didn’t seem to be picked up on K/N. As it actually turns out, it doesn’t seem to be applied at all when set in the spec itself. So this test passes on JVM but fails on K/N:
Copy code
class Foo : FunSpec({
  isolationMode = InstancePerTest
  var count = 0

  test("count is 1") {
    count++
    count shouldBe 1
  }

  test("count is still 1") {
    count++
    count shouldBe 1
  }
})