Skip to content

Commit 7a15c8b

Browse files
nohwndCopilot
andcommitted
Fix #2538: Container/block with discovery errors reported as Failed
Copilot-generated fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d5f7c87 commit 7a15c8b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Pester.RSpec.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ function PostProcess-RspecTestRun ($TestRun) {
176176
$b.Result = if ($b.Skip) {
177177
"Skipped"
178178
}
179+
elseif (0 -lt $b.ErrorRecord.Count) {
180+
"Failed"
181+
}
179182
elseif ($b.Passed) {
180183
"Passed"
181184
}
@@ -206,12 +209,12 @@ function PostProcess-RspecTestRun ($TestRun) {
206209
$b.result = if ($b.Skip) {
207210
"Skipped"
208211
}
209-
elseif ($b.Passed) {
210-
"Passed"
211-
}
212212
elseif (0 -lt $b.ErrorRecord.Count) {
213213
"Failed"
214214
}
215+
elseif ($b.Passed) {
216+
"Passed"
217+
}
215218
elseif (-not $discoveryOnly -and $b.ShouldRun -and (-not $b.Executed -or -not $b.Passed)) {
216219
"Failed"
217220
}

0 commit comments

Comments
 (0)