Skip to content

Latest commit

 

History

History
72 lines (45 loc) · 1.77 KB

TESTS.md

File metadata and controls

72 lines (45 loc) · 1.77 KB

Tests

coverlet

cd src/BlazorInteractive.Compilation.Tests
`dotnet test --collect:"XPlat Code Coverage"

TestResults/[GUID]/coverage.cobertura.xml

ReportGenerator -reports:"TestResults/**/coverage.cobertura.xml" -targetdir:coveragereport

coverlet.console

x86/x64 installation

dotnet tool install --global coverlet.console

ARM installation

dotnet tool install coverlet.console -g -a arm64

Running manually

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"

AltCover

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