Invoke-Pester -Tag @('A', 'B') runs any tests tagged with "A" or "B".
Describe 'foo1' -Tag 'A' {
It 'should be ok' {
1 | should be 1
}
}
Describe 'foo2' -Tag 'B' {
It 'should be ok' {
1 | should be 1
}
}
Describe 'foo3' -Tag @('A', 'B') {
It 'should fail' {
1 | should be 1
}
}
For example, here all 3 tests would be executed.
We have a situation, where it's desirable to run tests when all tags are present.
So in this case, only "foo3" would be run.
Changing the meaning of -Tag in Invoke-Pester is obviously not an option.
I'd like to propose to add a new parameter, maybe -TagAll that enable this scenario.
Invoke-Pester -TagAll @('A', 'B')
At the same time, we may rename -Tag into -TagAny and add alias -Tag to this parameter.
Also, maybe aliasing -ExcludeTag with -TagExclude will make exportability of all these 3 related parameters better.
For the context, I'm working on PowerShell/PowerShell#2280 where I'm adding a new tag "RequireAdminOnWindows" and this tag is orthogonal to our current used tags.
Invoke-Pester -Tag @('A', 'B')runs any tests tagged with "A" or "B".For example, here all 3 tests would be executed.
We have a situation, where it's desirable to run tests when all tags are present.
So in this case, only "foo3" would be run.
Changing the meaning of
-TaginInvoke-Pesteris obviously not an option.I'd like to propose to add a new parameter, maybe
-TagAllthat enable this scenario.At the same time, we may rename
-Taginto-TagAnyand add alias-Tagto this parameter.Also, maybe aliasing
-ExcludeTagwith-TagExcludewill make exportability of all these 3 related parameters better.For the context, I'm working on PowerShell/PowerShell#2280 where I'm adding a new tag "RequireAdminOnWindows" and this tag is orthogonal to our current used tags.