You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Set-ItResult, a duplicate because and an extra space is output:
cat .\test-docs.ps1 && Invoke-Pester .\test-docs.ps1 -Output Detailed
Describe "Example" {
It "Inconclusive test" {
Set-ItResult -Inconclusive -Because "we want it to be inconclusive"
}
It "Skipped test" {
Set-ItResult -Skipped -Because "we want it to be skipped"
}
}
Pester v5.6.1
Starting discovery in 1 files.
Discovery found 2 tests in 15ms.
Running tests.
Running tests from 'C:\git\Platform\test-docs.ps1'
Describing Example
[?] Inconclusive test is inconclusive, because because we want it to be inconclusive, 3ms (2ms|1ms)
[!] Skipped test is skipped, because because we want it to be skipped, 2ms (2ms|1ms)
Tests completed in 54ms
Tests Passed: 0, Failed: 0, Skipped: 1, Inconclusive: 1, NotRun: 0
Expected Behavior
For it to behave as per the documentation:
Get-Help Set-ItResult -Examples
NAME
Set-ItResult
SYNOPSIS
Set-ItResult is used inside the It block to explicitly set the test result
-------------------------- EXAMPLE 1 --------------------------
PS > ```powershell
Describe "Example" {
It "Inconclusive test" {
Set-ItResult -Inconclusive -Because "we want it to be inconclusive"
}
It "Skipped test" {
Set-ItResult -Skipped -Because "we want it to be skipped"
}
}
```
the output should be
```
Describing Example
[?] Inconclusive test is inconclusive, because we want it to be inconclusive 35ms (32ms|3ms)
[!] Skipped test is skipped, because we want it to be skipped 3ms (2ms|1ms)
Tests completed in 78ms
Tests Passed: 0, Failed: 0, Skipped: 1, Inconclusive: 1, NotRun: 0
```
Steps To Reproduce
Just copy the example from Get-Help Set-ItResult -Examples into a new file and Invoke-Pester thatfile -Output Detailed
Describe your environment
Pester version : 5.6.1 C:\Users\XXXXX\Documents\PowerShell\Modules\Pester\5.6.1\Pester.psm1
PowerShell version : 7.4.6
OS version : Microsoft Windows NT 10.0.22631.0
Possible Solution?
Sorry, I have not delved into Pester's code yet.
The text was updated successfully, but these errors were encountered:
Checklist
What is the issue?
When using Set-ItResult, a duplicate
because
and an extra space is output:Expected Behavior
For it to behave as per the documentation:
Steps To Reproduce
Just copy the example from
Get-Help Set-ItResult -Examples
into a new file andInvoke-Pester thatfile -Output Detailed
Describe your environment
Pester version : 5.6.1 C:\Users\XXXXX\Documents\PowerShell\Modules\Pester\5.6.1\Pester.psm1
PowerShell version : 7.4.6
OS version : Microsoft Windows NT 10.0.22631.0
Possible Solution?
Sorry, I have not delved into Pester's code yet.
The text was updated successfully, but these errors were encountered: