Skip to content

Instantly share code, notes, and snippets.

@DanielMPries
Last active December 11, 2019 02:16
Show Gist options
  • Save DanielMPries/797a2a0183ed0e7da857910f87431ad2 to your computer and use it in GitHub Desktop.
Save DanielMPries/797a2a0183ed0e7da857910f87431ad2 to your computer and use it in GitHub Desktop.
Coverlet settings
# Add coverlet to the test project(s)
dotnet add package coverlet.msbuild
# or for VSTest
# dotnet add package coverlet.collector
# Add the coverlet global cli tool
dotnet tool install --global coverlet.console
# coverage gutters vscode extension
ext install ryanluker.vscode-coverage-gutters
{
"version": "2.0.0",
"tasks": [{
"label": "Unit test with coverage",
"command": "dotnet",
"type": "process",
"args": [
"test",
"/p:CollectCoverage=true",
"/p:CoverletOutputFormat=lcov",
"/p:CoverletOutput=./lcov",
//"/p:Threshold=80", // #RelationshipGoals
"/p:ThresholdType=line",
"/p:ThresholdStat=total",
"--filter",
"TestCategory=Unit"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "List unit tests ",
"command": "dotnet",
"type": "process",
"args": [
"test",
"--list-tests",
"--filter",
"TestCategory=Unit"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "test",
"isDefault": true
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment