cd src/BlazorInteractive.Compilation.Tests
`dotnet test --collect:"XPlat Code Coverage"
TestResults/[GUID]/coverage.cobertura.xml
ReportGenerator -reports:"TestResults/**/coverage.cobertura.xml" -targetdir:coveragereport
dotnet tool install --global coverlet.console
dotnet tool install coverlet.console -g -a arm64
coverlet /path/to/test-assembly.dll --target "dotnet" --targetargs "test /path/to/test-project --no-build"
coverlet .\bin\Debug\netcoreapp2.1\hanselminutes.core.tests.dll --target "dotnet" --targetargs "test --no-build"
Run this from the src
directory:
coverlet BlazorInteractive.Compilation.Tests/bin/Debug/net7.0/BlazorInteractive.Compilation.dll --target "dotnet" --targetargs "test --no-build"
Change directory to BlazorInteractive.Tests
.
cd BlazorInteractive.Tests
Install AltCover.
dotnet tool install --global altcover.global
dotnet add package AltCover
Install ReportGenerator
dotnet tool install -g dotnet-reportgenerator-globaltool
Run this command to generate a html report from a coverage.xml
file.
dotnet reportgenerator -reports:coverage.xml -targetdir:./coverage -assemblyfilters:'+BlazorInteractive*;-*.Tests' -classfilters:'+BlazorInteractive.*';
Load the report file at BlazorInteractive.Tests/coverage/index.html