pester / Pester

Pester is the ubiquitous test and mock framework for PowerShell.
https://pester.dev/
Other
3.08k stars 470 forks source link

Remove Should legacy syntax error #2445

Closed fflaten closed 3 months ago

fflaten commented 4 months ago

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

fflaten commented 4 months ago

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.

nohwnd commented 4 months ago

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.