This is a cross-platform PowerShell module that allows you to publish Pester code coverage results to Coveralls.io.
In order to use this module, you will need Pester.
- The first step is to run your Pester tests, but using the
-CodeCoverage
switch:
# you'll need the source files
$srcFiles = (Get-ChildItem "$($pwd)/src/*.ps1" -Recurse -Force).FullName
# then, run your pester tests
$PesterReport = Invoke-Pester './tests' -CodeCoverage $srcFiles -PassThru
- Once you have your report, you can then make a report for Coveralls.io
$CoverallsReport = New-CoverallsReport -Coverage $PesterReport.CodeCoverage -ServiceName 'appveyor' -BranchName master
- Finally, you can publish that report to Coveralls.io
Publish-CoverallsReport -Report $CoverallsReport -ApiToken 'token'