![]() ![]()
NET Core Test Explorer extension (this should have hundreds of thousands of downloads - it's criminal) to get this nice Test Explorer pane:Įven better. Next, add in the totally under appreciated. You might be able to get it to work but it's easier to keep things separate. NOTE: If you're doing code coverage you'll want to ensure your tests and tested assembly are NOT the same file. I can run "WatchTests.cmd" in another terminal, or within the VS Code integrated terminal. \my.tests test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./ You can take it even further if you add "dotnet watch test" which will compile and re-run tests if code changes: dotnet watch -project. The files then watched by the VSCode Coverage Gutters extension and updates as the file changes if you click watch in the VS Code Status Bar. dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./. I should be able to pick the coverage file manually with the extension, but due to a small bug, it's easier to just tell Coverlet to generate a specific file name in a specific format. SF:C:\github\hanselminutes-core\re\MarkdownTagHelper.cs SF:C:\github\hanselminutes-core\re\Constants.cs Those lcov files look like this, showing file names, file numbers, coverage, and number of exceptions. There is a language agnostic VS Code Extension called Coverage Gutters that can read in lcov files and others and highlight line gutters with red, yellow, green to show test coverage. You can then generate detailed reports from this. We're close with this setup, although it's a little slow.Ĭoverlet can produce opencover, lcov, or json files as a resulting output file. Visual studio code coverage update#That means I want to have my tests open, my code open, and as I'm typing I want the solution to build, run tests, and update code coverage automatically the way Visual Studio proper does auto-testing, but in a more Rube Goldbergian way. I'm interested in "The Developer's Inner Loop.".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |