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

Update error messages in Should -Throw #2354

Merged
merged 3 commits into from Jun 7, 2023

Conversation

fflaten
Copy link
Collaborator

@fflaten fflaten commented May 18, 2023

PR Summary

Enhances Should -Throw assertion with:

  • Improved filter-summary in error message
  • Removes duplicate helper-functions covered by Format.ps1
  • Fixes error when ActualValue is missing or not a scriptblock.
    Missing BEFORE
    missing-before
    Non-scriptblock BEFORE (conversion error = printed whole function)
    non-before
    Missing or Non-scriptblock AFTER
    after

Fix #2064

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)

@fflaten fflaten added the Assertions For issues related with assertions label May 18, 2023
@fflaten fflaten changed the title Update error message in Should -Throw Update error messages in Should -Throw May 18, 2023
@fflaten fflaten added the Bug label May 18, 2023
@nohwnd nohwnd merged commit 9f9f285 into pester:main Jun 7, 2023
14 checks passed
@fflaten fflaten deleted the cleanup-pesterthrow branch June 7, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Assertions For issues related with assertions Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance Should -Throw Documentation with Error Scenario
2 participants