Skip to content

Commit c282cfa

Browse files
committed
Also fail on Pester block/container failures, not just failed tests
1 parent 0953fce commit c282cfa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/TestModule.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ $PesterConfiguration.TestResult.Enabled = $true
3636
$PesterConfiguration.TestResult.OutputPath = (Join-Path $ModuleTestsPath "$moduleName-TestResults.xml")
3737

3838
$TestResults = Invoke-Pester -Configuration $PesterConfiguration
39-
If ($TestResults.FailedCount -gt 0) { Write-Error "$($TestResults.FailedCount) tests failed." }
39+
If (($TestResults.FailedCount + $TestResults.FailedBlocksCount + $TestResults.FailedContainersCount) -gt 0) { Write-Error "Pester run failed: $($TestResults.FailedCount) failed test(s), $($TestResults.FailedBlocksCount) failed block(s), $($TestResults.FailedContainersCount) failed container(s), of $($TestResults.TotalCount) total tests" }

0 commit comments

Comments
 (0)