Skip to content

Commit

Permalink
Test for Inconclusive tests and count in ResultObject
Browse files Browse the repository at this point in the history
  • Loading branch information
csandfeld committed Feb 3, 2024
1 parent 7c219c2 commit 9ba12d5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tst/Pester.RSpec.ResultObject.ts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ i -PassThru:$PassThru {
It "not run" -Tag "Slow" {
1 | Should -Be 1
}

It "Set-ItResult -Inconclusive" {
Set-ItResult -Inconclusive
}

It "Set-ItResult -Skipped" {
Set-ItResult -Skipped
}
}
}
$result = Invoke-Pester -Configuration @{
Expand All @@ -119,7 +127,7 @@ i -PassThru:$PassThru {
$result | Verify-Property "Containers"
$result.Containers.Count | Verify-Equal 2

$result.TotalCount | Verify-Equal 4
$result.TotalCount | Verify-Equal 6
$result.Tests | Verify-NotNull

$result.PassedCount | Verify-Equal 1
Expand All @@ -128,12 +136,15 @@ i -PassThru:$PassThru {
$result.FailedCount | Verify-Equal 1
$result.Failed | Verify-NotNull

$result.SkippedCount | Verify-Equal 1
$result.SkippedCount | Verify-Equal 2
$result.Skipped | Verify-NotNull

$result.NotRunCount | Verify-Equal 1
$result.NotRun | Verify-NotNull

$result.InconclusiveCount | Verify-Equal 1
$result.Inconclusive | Verify-NotNull

$result.Duration | Verify-Equal ($result.Containers[0].Duration + $result.Containers[1].Duration)
$result.UserDuration | Verify-Equal ($result.Containers[0].UserDuration + $result.Containers[1].UserDuration)
$result.FrameworkDuration | Verify-Equal ($result.Containers[0].FrameworkDuration + $result.Containers[1].FrameworkDuration)
Expand Down

0 comments on commit 9ba12d5

Please sign in to comment.