en-US/about_PSCoverage.help.txt

TOPIC
        about_PSCoverage
 
SHORT DESCRIPTION
        This module provides a simple interface to coveralls.io. It enables you to format your coverage report
        generated by Pester to upload it.
 
LONG DESCRIPTION
        Unfortunately Pester does not provide any interfaces to upload the coverage reports to external services.
        Therefore this module was developed.
 
INSTALLING PSCoverage
        The easiest way to install this module is to use the PowerShell built in package management. Therefore use
        `Install-Module 'PSCoverage'` to get the latest release from powershellgallery.com.
 
 
GETTING STARTED
        Navigate to your module/ repository root. Your module structure needs to be like this:
 
        Eg.:
        ----------------------------------------
        ~\src\
              Private\
                      Invoke-Foobar.ps1
              Functions\
              External\
        ~\tests\
                Private\
                        Invoke-Foobar.Tests.ps1
                Functions\
                External\
        ~\ModuleManifest.psd1
        ~\ModuleScript.psm1
        ----------------------------------------
 
        1. First you need a file map for source and pester files. You generate a new with:
 
        $FileMap = New-PesterFileMap -SourceRoot '.\src' -PesterRoot '.\tests'
 
        The map represents a listing of each source file and its pester file.
 
        2. Next you generate your coverage report:
 
        $CoverageReport = New-CoverageReport -PesterFileMap $FileMap -RepoToken 'abcd1234'
 
        This runs Invoke-Pester with the appropriate parameters. Keep in mind that you run your unit tests again,
        if you put PSCoverage in your release pipeline.
 
        3. Finally we can upload the coverage report to coveralls.io:
 
        Publish-CoverageReport -CoverageReport $CoverageReport
 
SEE ALSO
        about_PSCoverage