Pester icon indicating copy to clipboard operation
Pester copied to clipboard

Remove Should legacy syntax error

Open fflaten opened this issue 1 year ago • 2 comments

PR Summary

Removes the custom exception thrown when calling Should with legacy Pester 3 syntax. The syntax is not supported and the custom error caused too many false positives.

Before:

> 1 | Should Be 2
Should: Cannot retrieve the dynamic parameters for the cmdlet. Legacy Should syntax (without dashes) is not supported in Pester 5. Please refer to migration guide at: https://pester.dev/docs/migrations/v3-to-v4

After:

> 1 | Should Be 2                               
Should: Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.

Fix #2437 Fix #2138

[!NOTE] If rollback becomes necessary, include code in #2325 to fix #2138

PR Checklist

  • [x] PR has meaningful title
  • [x] Summary describes changes
  • [x] 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.
  • [x] Tests are added/update (if required)
  • [ ] Documentation is updated/added (if required)

fflaten avatar May 07 '24 20:05 fflaten

Do we need to update the dev/6.x.x branch before merging any PRs? Merging dev with main would keep PS3 support atm since it was reverted in main only.

fflaten avatar May 07 '24 20:05 fflaten

Definitely, I wanted to merge main into dev/6.x.x but I think it wanted a merge commit, which did not seem right. So I want to soon (tomorrow?) release final preview of 5.x.x, and snap release branch for it, and then move main to 6.x.x and re-apply the changes, hopefully without much mess.

nohwnd avatar May 13 '24 08:05 nohwnd