/PSCoveralls

Cross-platform PowerShell module that allows you to publish Pester code coverage results to Coveralls.io

Primary LanguagePowerShellMIT LicenseMIT

PSCoveralls

MIT licensed

This is a cross-platform PowerShell module that allows you to publish Pester code coverage results to Coveralls.io.

Example

In order to use this module, you will need Pester.

  1. 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
  1. Once you have your report, you can then make a report for Coveralls.io
$CoverallsReport = New-CoverallsReport -Coverage $PesterReport.CodeCoverage -ServiceName 'appveyor' -BranchName master
  1. Finally, you can publish that report to Coveralls.io
Publish-CoverallsReport -Report $CoverallsReport -ApiToken 'token'