I have a REST service that is being tested using Pester and our PowerShell REST client (implemented using PowerShell's Invoke-RestMethod
and friends).
How would I generate code coverage for it ?
Test is initiated using:
dotnet run
to start the service in the backgroundinvoke-pester
that runs integration testSince we don't have by the book testing here using dot net test project, nor dotnet test
command is used, how would I generate code coverage in such scenario ?
I tried with OpenCover and it starts up the app this way and tests run trough it, but its results.xml
is almost empty (checked debug mode and presence of PDB files)
$env:ASPNETCORE_URLS = 'http://localhost:3001'
OpenCover -target:"c:\program files\dotnet\dotnet.exe" -targetargs:"run --no-build --no-restore --no-launch-profile --configuration Debug"
I made it working like a charm with dotCover CLI