reevn
07/20/2020, 2:28 PMbeforeTest
of a nested scope is not executed for child scopes when the default isolation mode is chosen?
Example:
// beforeTest on the most outer level at the top of the spec
beforeTest { ... }
describe("some scope") {
beforeTest { ... }
// for these tests, the outer level and "some scope" beforeTest functions are executed in order before each test
it("test a") { ... }
it("test b") { ... }
describe("some deeper scope") {
// for all these tests only the top level beforeTest is executed before each one, but the "some scope" one is never executed
it("test c") { ... }
it("test d") { ... }
}
}
When I change to IsolationMode.InstancePerLeaf
it works, but I don't really need separate instances, I just need the beforeTests
of each parent to be executed for each test case. If this is a bug, I'm happy to create an issue.sam
07/20/2020, 2:38 PMreevn
07/20/2020, 2:40 PMIsolationMode
only worked by chance for my specific test class. I tested with a minimal setup again and it looks like a bug regardless of isolation mode.
I created an issue: https://github.com/kotest/kotest/issues/1574