-
-
Notifications
You must be signed in to change notification settings - Fork 470
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
HaveParameter is not dependent on format of param block #2288
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this issue!
This looks great - and so much simpler! I've added a few suggestions.
Would you mind also adding a test in tst/functions/assertions/HaveParameter.Tests.ps1
?
Ex the one you provided in the issue comment?
Commenter does not have sufficient privileges for PR 2288 in repo pester/Pester |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late response. See updated comments 🙂
…ded dedicated test for paramblock with opening paren on new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
PR Summary
Get-ParameterInfo wasn't leveraging ASTs because of previous support for PowerShell v2 and required that the opening parenthesis for the param block be on the same line as the keyword. This change leverages ASTs for Get-ParameterInfo so that HaveParmeter is format agnostic.
Fix #2285
PR Checklist
Create Pull Request
to mark it as a draft. PR can be markedReady for review
when it's ready.