I have written some Test methods using Junit and mockito. My tests run fine. However, I am not able to see code coverage.
No matter which option I click on, nothing is shown in code coverage.
I clicked on EDIT to fix configuration seetings
displayed in middle of code coverage window on right. This is what I get :
What should I do to get code coverage results ?
This is my folder structure :
From the main menu, select Run | Show Coverage Data ( Ctrl+Alt+F6 ). In the Choose Coverage Suite to Display dialog, select the checkboxes next to the necessary suites, and click Show selected. IntelliJ IDEA opens the coverage results for the selected test suites.
To disable code coverage highlighting In the IDEA IDE, on the Analyze menu, click Show Code Coverage Data, or use the Ctrl+Alt+F6 keyboard shortcut. In the Code Coverage Suites dialog, choose No coverage.
In IntelliJ to add "branch coverage" to the coverage window, you can go to Run/EditConfiguration then proceed to Modify options/coverage setting and enable use tracing.
To see coverage for production code change the pattern to com.cdk.dmg.asset
.
You need to Enable coverage in test folders if you want see coverage in tests (this option is disabled on your screenshot and the pattern is set to record data for tests only, hence no results).
Make sure you have the Coverage
plugin enabled! (yes, it's named literally just "Coverage")
Enabling it did it for me.
You don't need to download it from Marketplace, the plugin comes bundled with IntelliJ Idea.
It's my understanding that it should be enabled by default ..but for some reason that wasn't the case for me, so it might as well not be the case for you either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With