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

Fix console warnings in Should-BeEquivalent.Tests.ps1 #2488

Merged
merged 5 commits into from
Jun 14, 2024

Conversation

fflaten
Copy link
Collaborator

@fflaten fflaten commented Jun 9, 2024

PR Summary

Removes "Getting default equivalency options" warning spam in tests.ps1 ouptut. Fixed by providing default options by... well, default in Should-BeEquivalent.Tests.ps1.

Also replaces some calls to New-Object

PR Checklist

  • PR has meaningful title
  • Summary describes changes
  • PR is ready to be merged
    • If not, use the arrow next to Create Pull Request to mark it as a draft. PR can be marked Ready for review when it's ready.
  • Tests are added/update (if required)
  • Documentation is updated/added (if required)

@nohwnd
Copy link
Member

nohwnd commented Jun 12, 2024

Clever. I would not think about doing it this way. Can the warning now be removed from the assertion and throw when the options are not provided?

@fflaten
Copy link
Collaborator Author

fflaten commented Jun 13, 2024

Yes, I can update the PR tomorrow unless you've already fixed it by then.

@nohwnd
Copy link
Member

nohwnd commented Jun 13, 2024

I won't, too many other things to fix before psconf :D

@fflaten
Copy link
Collaborator Author

fflaten commented Jun 13, 2024

Changed to only check if parameter was not provided (allows null). PSDefaultParameters-trick didn't work for nested Compare-Equivalent calls even if I set the default option for the caller, e.g.Compare-DictionaryEquivalent.

Didn't bother to troubleshoot further after I noticed title change on issue #2477 planning to remove this code 🙂

@nohwnd nohwnd merged commit f6ce6dd into pester:main Jun 14, 2024
11 checks passed
@fflaten fflaten deleted the fix-ci-noise branch June 14, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants