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

Should-BeFals*/Should-BeTru*: The commands are missing named parameter Expected #2517

Closed
3 tasks done
johlju opened this issue Jun 29, 2024 · 3 comments
Closed
3 tasks done
Labels

Comments

@johlju
Copy link
Contributor

johlju commented Jun 29, 2024

Checklist

Summary of the feature request

Looking at the help for he commands

  • Should-BeFalse
  • Should-BeFalsy
  • Should-BeTrue
  • Should-BeTruthy

they are all missing the named parameter Expected which for example Should-Be and Should-BeExactly has.

Also, these commands has the positional parameter 1 set to Actual while position 2 is set to Because. That also differ from Should-Be and Should-BeExactly which has position 1 set to Expected and position 2 is set to Actual.

How should it work?

Is this meant to be this way, or is this something that should be resolved? I curious because it would simplify conversion from Pester 5 format to Pester 6 format if the commands behave the same. 🙂

@johlju johlju added the Feature label Jun 29, 2024
@fflaten
Copy link
Collaborator

fflaten commented Jun 30, 2024

What would you use -Expected for?

The assertions match against a constant value as they're basically shortcuts for something like $var | Should-HaveType ([bool]); $var | Should-Be $true (True) and $var | Should-Be $true (Truthy).

@johlju
Copy link
Contributor Author

johlju commented Jul 1, 2024

Ah, of course. It was me that did not think that one through. Then the answer is it is meant to be that way.

I'm writing a syntax conversion module (Pester 5 syntax -> Pester 6 syntax), thats when I saw the difference from the other two commands. 🙂 Yesterday I saw a difference between Should -Throw and Should-Throw too. Will post another issue for that one when I have time, just to make sure it is meant to be (by design) or something that should be looked into.

Closing this one. Thank you for the quick response @fflaten!

@johlju johlju closed this as completed Jul 1, 2024
@fflaten
Copy link
Collaborator

fflaten commented Jul 1, 2024

Thank you for testing it out and providing feedback! Looking forward to trying out the conversion-module 🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants