James Eschner
04/04/2022, 9:32 PMclass ProjectConfig : AbstractProjectConfig() {
override fun listeners(): List<TestListener> = listOf(SystemEnvironmentProjectListener("foo", "bar"))
}
but AbstractProjectConfig::listeners is deprecated and the deprecation message, “`Use extensions."` , isn’t the most helpful. I would like to define the listener once for the whole project.
* Not a contribution *Emil Kantis
04/04/2022, 9:55 PMobject EnvironmentExtension : TestCaseExtension {
override suspend fun intercept(testCase: TestCase, execute: suspend (TestCase) -> TestResult): TestResult {
return withEnvironment("" to "") {
execute(testCase)
}
}
}
object ProjectConfig : AbstractProjectConfig() {
override fun extensions() = listOf(EnvironmentExtension)
}
I can try updating the readme if it works. Perhaps we could also raise an issue about creating a replacement for SystemEnvironmentProjectListener
James Eschner
04/04/2022, 10:10 PMextensions
was a function in AbstractProjectConfig
. I thought when the message said “extensions” it was talking about extensions in the abstract 😅James Eschner
04/04/2022, 10:14 PMListener
is an Extension
so this might just work, trying now…Emil Kantis
04/04/2022, 10:17 PM