Hello :wave: Today i wanted to replace my custom `...
# stdlib
m
Hello đź‘‹ Today i wanted to replace my custom
Result
class with Kotlin Result then I just realised that my coverage was decreased . Unfortunately none of the
onSuccess
and
onFailure
methods were covered. • Is there any plan of covering them ? • How do you guys cover these methods are you writing Unit test on Kotlin Result methods ?
b
You need kover to cover inline stuff. Jacoco cannot handle that.
m
I already use kover and they are not covered with kover too
k
I had a play with Result and could see all lines being covered by using the IDE's own "Debug with coverage".
m
even the
.onSuccess{..}
.onFailure{..}
lines ? That’s interesting, do you use some tool like Codecov or Cadacy ? if yes, do you see these lines covered in the consoles ?
k
I just created a new Kotlin project straight in the IDE, using no other tools except JUnit 5. I right-click on the test and choose "Run test with coverage". This uses the IDE's own coverage analyzer, no external tool. It shows that the block arguments to onSuccess and onFailure are both covered by the test.
b
Ah, but you can't use that in CI, so not much use of it these days.
Plus ij coverage tool has little to do with jacoco or junit
m
Yea also that one doesn’t really work well with Kotlin Multiplatfrom (at least in my project 🙂 )