How to cover lambda function in coverage kotlin

270 Views Asked by At

I am using jococo for test coverage. I want to cover every package, but I added this code

@Retention(AnnotationRetention.BINARY)
annotation class NoCoverageGenerated

to not excluded that class which I don't want to cover. But there is problem inside that class if we have any lambda function it not covering that lambda function. How can we cover lamda function ?

@NoCoverageGenerated
class ABC {
   
   private val OnSuccessListener: (any: Any?) -> Unit = { _ ->
      xyz()
   }
}
0

There are 0 best solutions below