![]() Note that both the Flutter Coverage and Coverage Gutters use the file to show the coverage data. This is great as it tells you exactly which parts of your code are not covered on a line-by-line basis! □ If you click on it, it will check the test coverage info (in the file), and you'll see green or red gutters next to each line in the editor: Coverage gutters in the code editor Once you install the Coverage Gutters Extension, a little Watch button will appear in the bottom bar: Coverage Gutters: click to watch Once you have installed the Flutter Coverage extension, it will appear in your testing tab and show you the coverage info for all files and folders: Flutter test coverage panel in VSCodeīased on the coverage percentage, you'll also get three different icons showing you which parts of your code need more tests:īut what if you wanted to see test coverage in the code editor itself? The Coverage Gutters Extension Luckily, there are two VSCode extensions to make life easier. ![]() While this report is helpful, during development it's not practical to read it in the browser. ![]() In other words, you still have to ensure all your tests pass. Note that the report tells you if there are tests that cover a given line, not if those tests pass or not. What's nice about the file report is that all relevant lines are color-coded (blue: covered, red: not covered). Example: LCOV code coverage report for a single file ![]() This will generate the report and open a page on your browser that looks like this: LCOV code coverage report for the entire projectįrom here, you can drill into each directory and open each file individually. To avoid checking them in to git, add coverage/ to your. The generated HTML report will create a lot of files. # Generate HTML report # Note: on macOS you need to have lcov installed on your system (`brew install lcov`) to use this:
0 Comments
Leave a Reply. |