17

How can I check the code coverage of my C# Unit Tests in VS Code?

The Code Coverage tool that I've used (because of it's simplicity, it is usable in the terminal) is MiniCover. The MiniCover Tool is, however, as of Jan 24 2018, only doing line coverage, and is not integrated into the IDE.

Jesper
  • 2,044
  • 3
  • 21
  • 50
  • See documentation for a tool you want to use. That should be sufficient... If not, there are probably a couple of tutorials and youtube videos for the tool. – FCin Nov 28 '17 at 11:00
  • 3
    We are using https://github.com/tonerdo/coverlet as a coverage tool. Coverage Gutters extension for VS Code does a UI support for generated reports. Works in MacOS – xwrs Apr 13 '18 at 11:42
  • 4
    Off topic? Seriously SO. get to 21st century – pixel Oct 31 '18 at 14:34
  • This is a top google result when searching for code coverage for vscode. It should be opened and answered. FWIW, I found a great Scott Hanselman post but found that coverage gutters doesnt support c# currently. https://www.hanselman.com/blog/automatic-unit-testing-in-net-core-plus-code-coverage-in-visual-studio-code – crthompson Mar 09 '22 at 16:44
  • We certainly have other posts like it. https://stackoverflow.com/questions/70321465/how-to-get-code-coverage-from-unit-tests-in-visual-studio-2022-community-edition – crthompson Mar 09 '22 at 16:47
  • This could be helpful https://stackoverflow.com/questions/76946038/how-do-i-see-dotnet-line-coverage-in-vscode . – Yoro Aug 24 '23 at 07:48

0 Answers0