IntelliJ Code Coverage: how to know which unit tests covered lines in source code
Asked Answered
I

1

6

I'm pretty new to this awesome feature of IntelliJ. When I run code coverage, I can see in the IDE green marks that indicate the line was covered and red marks that indicate the line was not covered. It's great, but I want to see what were the unit tests that covered these lines.

When I click the green marks, I only see number of hits:

enter image description here

Do you know how to see it?

Indira answered 21/9, 2021 at 10:19 Comment(2)
I know that OpenClover has such a feature, but I have no clue if there is IntelliJ integration that would show this.Blindheim
@WimDeblauwe I tried it now. It is really heavy and increases the loading time of Intellij.Indira
J
9

At first you need to enable the "Tracing" in Run configuration: enter image description here

Then you may use "Show tests covering line" button: enter image description here

Jennifferjennilee answered 21/9, 2021 at 13:38 Comment(1)
In my case the option is called "Enable branch coverage and test tracking" (using 2023.2)Skijoring

© 2022 - 2024 — McMap. All rights reserved.