What problem does it solve?
Upgrading Pester test suites across major versions breaks existing tests in non-obvious ways — the v4→v5 Discovery/Run split silently nulls variables, mock assertions get renamed or removed, and legacy Invoke-Pester parameters stop working. This Skill provides version-detection heuristics, a step-by-step migration workflow, and symptom-to-fix tables so suites get green again without changing what they assert.
Core Features & Use Cases
- Version Detection Heuristics: Identify which Pester version a suite was written for from syntax patterns like
Should Be, $MyInvocation.MyCommand.Path, or Assert-MockCalled.
- Per-Jump Migration Guides: Detailed references for v3→v4 (syntax renames), v4→v5 (Discovery/Run restructuring, BeforeAll, $PSScriptRoot, -ForEach), and v5→v6 (breaking changes like removed mock fall-through and empty -ForEach throwing).
- Invoke-Pester Parameter Mapping: Convert legacy v4 parameters (-Script, -OutputFile, -CodeCoverage) to the New-PesterConfiguration object model.
- Use Case: A CI pipeline fails after bumping Pester from 4 to 5 because setup code at the top of *.Tests.ps1 files runs during Discovery instead of Run. The Skill walks you through moving imports into BeforeAll, converting foreach-generated tests to -ForEach, and re-running until the suite matches its baseline.
Quick Start
Migrate my Pester test suite in the tests folder from version 4 to version 5 and fix any failures.