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
Hey, I wonder if you can add What is the reason a test was skipped
the current return object you will get if you using -PassThru doesn't contain any info on this
maybe you can add parameter name -Reason 'the reason it skipped'
PS D:\Github\pwshchakraui>$results.Skipped[0]
Name : Has help comment block
Path : {New-Tab, Comment Base Help, Has help comment block}
Data :
ExpandedName : Has help comment block
ExpandedPath : New-Tab.Comment Base Help.Has help comment block
Result : Skipped
ErrorRecord : {}
StandardOutput :
Duration : 00:00:00.0054751
ItemType : Test
Id :
ScriptBlock :
$FilePath| Should -FileContentMatch "<#"$FilePath| Should -FileContentMatch "#>"
Tag :
Focus : False
Skip : True
Block : [!] Comment Base Help
First : True
Last : False
Include : False
Exclude : False
Explicit : False
ShouldRun : True
StartLine : 9
Executed : True
ExecutedAt : 8/14/202111:43:21 AM
Passed : True
Skipped : True
UserDuration : 00:00:00
FrameworkDuration : 00:00:00.0054751
PluginData :
FrameworkData :
How should it work? (optional)
Describe "describe1" {
Context "with one skipped test" {
It "test 1"-Skip -Reason 'i want it to skip' {
1| Should -Be 2
}
It "test 2" {
1| Should -Be 1
}
}
Describe "that is skipped"-Skip -Reason 'i want it to skip all the tests' {
It "test 3" {
1| Should -Be 2
}
}
Context "that is skipped and has skipped test"-Skip -Reason 'i want all the It tests to skip' {
It "test 3"-Skip {
1| Should -Be 2
}
It "test 3" {
1| Should -Be 2
}
}
}
So the return object will look something like this.
Name : Has help comment block
Path : {New-Tab, Comment Base Help, Has help comment block}
Data :
ExpandedName : Has help comment block
ExpandedPath : New-Tab.Comment Base Help.Has help comment block
Result : Skipped
ErrorRecord : {}
StandardOutput :
Duration : 00:00:00.0054751
ItemType : Test
Id :
ScriptBlock :
$FilePath| Should -FileContentMatch "<#"$FilePath| Should -FileContentMatch "#>"
Tag :
Focus : False
Skip : True
Block : [!] Comment Base Help
First : True
Last : False
Include : False
Exclude : False
Explicit : False
ShouldRun : True
StartLine : 9
Executed : True
ExecutedAt : 8/14/202111:43:21 AM
Passed : True
Skipped : True
If someone were to submit a PR to implement this, is it something that the project would be interested in reviewing and merging? This is a feature that I would very much like to see, and would be willing to attempt to implement.
I've taken a stab at implementing something for this in #2607, as well as updating Set-ItResult so that it's reasons are also exported to the rest results. It is currently WIP as I have to cleanup the commit messages, and remove some extraneous files.
Summary of the feature request
Hey, I wonder if you can add What is the reason a test was skipped
the current return object you will get if you using
-PassThru
doesn't contain any info on thismaybe you can add parameter name
-Reason
'the reason it skipped'How should it work? (optional)
So the return object will look something like this.
The text was updated successfully, but these errors were encountered: