How can I rewrite this snippet using the Kotlin DS...
# community-support
i
How can I rewrite this snippet using the Kotlin DSL?
Copy code
test {
   onOutput { descriptor, event ->
       if (event.destination == TestOutputEvent.Destination.StdErr) {
           logger.error("Test: " + descriptor + ", error: " + event.message)
       }
   }
}
I'm struggling on
onOuput
. I guess it's something like
Copy code
onOutput(closureOf<???> {})
but I don't know what the type is.
c
closureOf
does not work here. as you can see in the function documentation, the receiver gets 2 paramters. so you need something like
Copy code
onOutput(KotlinClosure2<TestDescriptor, TestOutputEvent, Unit>({ description, event -> Unit }))
a
i
Thanks!