What problem does it solve?
Migrating a Pester test suite from classic v5 assertions (Should -Be, Should -Not -Be) to the new v6 Should-* operators is error-prone: many operators were renamed, negation became separate commands, and several assertions changed behavior (truthy vs. strict booleans, collection handling, case sensitivity). This Skill provides a verified mapping and procedure to convert assertions without silently breaking tests.
Core Features & Use Cases
- Operator-by-operator mapping: Converts classic assertions like
Should -BeExactly to Should-BeString -CaseSensitive and Should -BeGreaterOrEqual to Should-BeGreaterThanOrEqual, with a full reference table in references/assertion-map.md.
- Behavioral gotcha detection: Flags conversions that are not plain renames, such as
Should -BeTrue (truthy) vs. Should-BeTrue (strict), Should -BeNullOrEmpty splitting by intent, and collection comparisons requiring Should-BeCollection.
- Verification and enforcement: Runs
Invoke-Pester to confirm the suite stays green and optionally sets Should.DisableV5 to prevent classic syntax from creeping back.
- Use Case: A team upgrading to Pester 6 asks to modernize all
*.Tests.ps1 files; the Skill converts hundreds of Should -... calls, rewrites Assert-MockCalled to Should-Invoke, and reports assertions needing human decisions.
Quick Start
Migrate all classic Should assertions in my tests folder to the new Pester v6 Should-* syntax and run the suite to verify nothing broke.