I've implemented a TestListener
as follows:
object IntegrationTest: TestListener {
override fun beforeProject() {
println("integration tests - beforeProject")
}
override fun beforeSpec(description: Description, spec: Spec) {
println("integration tests - beforeSpec")
}
}
And used it in a test:
class SimpleTest: StringSpec() {
override fun listeners() = listOf(IntegrationTest)
init {
"it - 1" {
println("it - 1")
}
"it - 2" {
println("it - 2")
}
}
}
The problem is that integration tests - beforeProject
is never printed in the output.
The result is:
integration tests - beforeSpec
it - 1
it - 2
I tried it in intellij and using gradle CLI. Am I missing something?