task/Test/TestModule.ps1
BuildTask TestModule -Stage Test -Properties @{ Order = 2 Implementation = { if (-not (Get-ChildItem (Join-Path $buildInfo.Source 'test') -Filter *.tests.ps1 -Recurse -File)) { throw 'The PS project must have tests!' } Import-Module $buildInfo.ReleaseManifest -Global -ErrorAction Stop $params = @{ Script = Join-Path $buildInfo.Source 'test' CodeCoverage = $buildInfo.ReleaseRootModule OutputFile = Join-Path $buildInfo.Output ('{0}.xml' -f $buildInfo.ModuleName) PassThru = $true } $pester = Invoke-Pester @params $path = Join-Path $buildInfo.Output 'pester-output.xml' $pester | Export-CliXml $path } } |