Closed johlju closed 4 months ago
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).
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!
Thank you for testing it out and providing feedback! Looking forward to trying out the conversion-module 🤩
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 exampleShould-Be
andShould-BeExactly
has.Also, these commands has the positional parameter 1 set to
Actual
while position 2 is set toBecause
. That also differ fromShould-Be
andShould-BeExactly
which has position 1 set toExpected
and position 2 is set toActual
.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. 🙂