Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd committed Jan 17, 2025
1 parent 0fcb45f commit a77ca3e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
5 changes: 1 addition & 4 deletions tst/Pester.RSpec.TestResults.JUnit4.ts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ i -PassThru:$PassThru {
$failureLine = $sb.StartPosition.StartLine + 3
$stackTraceText = @($xmlTestCase.failure.'#text' -split "`n" -replace "`r")
$stackTraceText[0] | Verify-Equal "at ""Testing"" | Should -Be ""Test"", ${PSCommandPath}:$failureLine"
$stackTraceText[1] | Verify-Equal "at <ScriptBlock>, ${PSCommandPath}:$failureLine"
}

t "should write skipped and filtered test results counts" {
Expand Down Expand Up @@ -138,9 +137,7 @@ i -PassThru:$PassThru {
$failureLine = $sb.StartPosition.StartLine + 3
$stackTraceText = @($xmlTestCase.failure.'#text' -split "`n" -replace "`r")
$stackTraceText[0] | Verify-Equal "[0] at ""Testing"" | Should -Be ""Test"", ${PSCommandPath}:$failureLine"
$stackTraceText[1] | Verify-Equal "at <ScriptBlock>, ${PSCommandPath}:$($sbStartLine+3)"
$stackTraceText[2] | Verify-Equal "[1] at <ScriptBlock>, ${PSCommandPath}:$($sbStartLine+7)"

$stackTraceText[1] | Verify-Equal "[1] at <ScriptBlock>, ${PSCommandPath}:$($sbStartLine+7)"
}

t "should use expanded path and name when there are any" {
Expand Down
5 changes: 1 addition & 4 deletions tst/Pester.RSpec.TestResults.NUnit25.ts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ i -PassThru:$PassThru {
$failureLine = $sb.StartPosition.StartLine + 3
$stackTraceText = $xmlTestCase.failure.'stack-trace' -split "`n"
$stackTraceText[0] | Verify-Equal "at ""Testing"" | Should -Be ""Test"", ${PSCommandPath}:$failureLine"
$stackTraceText[1] | Verify-Equal "at <ScriptBlock>, ${PSCommandPath}:$failureLine"
}

t "should write a failed test result when there are multiple errors" {
Expand Down Expand Up @@ -102,9 +101,7 @@ i -PassThru:$PassThru {
$failureLine = $sb.StartPosition.StartLine + 3
$stackTraceText = $xmlTestCase.failure.'stack-trace' -split "`n"
$stackTraceText[0] | Verify-Equal "[0] at ""Testing"" | Should -Be ""Test"", ${PSCommandPath}:$failureLine"
$stackTraceText[1] | Verify-Equal "at <ScriptBlock>, ${PSCommandPath}:$($sbStartLine+3)"
$stackTraceText[2] | Verify-Equal "[1] at <ScriptBlock>, ${PSCommandPath}:$($sbStartLine+7)"

$stackTraceText[1] | Verify-Equal "[1] at <ScriptBlock>, ${PSCommandPath}:$($sbStartLine+7)"
}

t "should write a skipped test result" {
Expand Down
5 changes: 1 addition & 4 deletions tst/Pester.RSpec.TestResults.NUnit3.ts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ i -PassThru:$PassThru {
$failureLine = $sb.StartPosition.StartLine + 3
$stackTraceText = $xmlTestCase.failure.'stack-trace'.'#cdata-section' -split "`n"
$stackTraceText[0] | Verify-Equal "at 'Testing' | Should -Be 'Test', ${PSCommandPath}:$failureLine"
$stackTraceText[1] | Verify-Equal "at <ScriptBlock>, ${PSCommandPath}:$failureLine"
}

t 'should write a failed test result when there are multiple errors' {
Expand Down Expand Up @@ -105,9 +104,7 @@ i -PassThru:$PassThru {
$failureLine = $sb.StartPosition.StartLine + 3
$stackTraceText = $xmlTestCase.failure.'stack-trace'.'#cdata-section' -split "`n"
$stackTraceText[0] | Verify-Equal "[0] at 'Testing' | Should -Be 'Test', ${PSCommandPath}:$failureLine"
$stackTraceText[1] | Verify-Equal "at <ScriptBlock>, ${PSCommandPath}:$($sbStartLine+3)"
$stackTraceText[2] | Verify-Equal "[1] at <ScriptBlock>, ${PSCommandPath}:$($sbStartLine+7)"

$stackTraceText[1] | Verify-Equal "[1] at <ScriptBlock>, ${PSCommandPath}:$($sbStartLine+7)"
}

t 'should write a skipped test result' {
Expand Down

0 comments on commit a77ca3e

Please sign in to comment.