Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support convert Should -HaveCount to v6 syntax #19

Open
johlju opened this issue Jul 12, 2024 · 3 comments
Open

Support convert Should -HaveCount to v6 syntax #19

johlju opened this issue Jul 12, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@johlju
Copy link
Member

johlju commented Jul 12, 2024

Dependent on issue being tracked in pester/Pester#2534.

@johlju
Copy link
Member Author

johlju commented Jul 13, 2024

There will be a parameter Count for Should-BeCollection. But it while it being developed ww can use .Count instead and use Should-Be.

pester/Pester#2534 (comment)

The Pester 5 syntax:

$collection | Should -HaveCount 3
# or
$collection | Get-Something | Should -HaveCount 3

Would be converted to:

($collection).Count | Should-Be 3
# or
($collection | Get-Something).Count | Should-Be 3

@johlju
Copy link
Member Author

johlju commented Jul 13, 2024

When Count is introduced to Should-BeCollection then the above Pester 5 syntax should be converted to:

$collection | Should-BeCollection -Count 3
# or
$collection | Get-Something | Should-BeCollection -Count 3

@johlju
Copy link
Member Author

johlju commented Jul 13, 2024

It might be worth waiting for Count to be introduced to Should-BeCollection because it would be a pain to convert it back if it has first been converted to .Count.

@johlju johlju added enhancement New feature or request help wanted Extra attention is needed labels Jul 13, 2024
@johlju johlju added this to the 1.0.0 milestone Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant