Is withData `TestType.Test` <@U12AGS8JG>? (In the ...
# kotest
d
Is withData
TestType.Test
@sam? (In the listener this is the check:
Copy code
private fun TestCase.isApplicable() = (mode == KoinLifecycleMode.Root && description.isRootTest()) ||
   (mode == KoinLifecycleMode.Test && type == TestType.Test)
s
No its test type container
d
Oh... so I guess I'll have to add a Container mode to that listener for it to work... thanks!
d
Is there some kind of
TestType.Leaf
?
s
TestType.Test
I just said leaf in there to remind myself to call the parameter leaf
withData(1,2,3, leaf = true) { }
I think that makes more sense than testType = TestType.Test to people who don't know the innards of kotest
d
🙃 It seems like multiple containers tries starting up Koin multiple times, whereas I'd like the most inner container (the withData) BEFORE the `it`s inside it...
s
yeah that's quite specific
if you want to use koin, I would use withData at the root level
d
I tried using:
Copy code
private fun TestCase.isApplicable() = (mode == KoinLifecycleMode.Root && description.isRootTest())
        || (mode == KoinLifecycleMode.Test && type == TestType.Test)
        || (mode == KoinLifecycleMode.Container && type == TestType.Container)
in the KoinListener but it doesn't work...
Even with a describeSpec?
s
Copy code
class Foo : DescribeSpec({
  withData(1,2,3) { }
})
that would work with koin
basically you can't have nested tests with it
d
Maybe there should be a DataTestSpec? It seems like there's just too many conditions to work with them... Koin, IsolationMode problems...
s
It's more a problem with nested tests in general
Once you start nesting you have to decide what you're going to treat as a single test unit
I might rename TestType.TEST to LEAF in 5.0
I just copied the junit naming and it's not very clear
d
Then what would you do about isolation mode instance per leaf?