|
| 1 | +--- |
| 2 | +title: Migrating Pester tests |
| 3 | +description: A repository-wide checklist for migrating PSModule test sets to Pester 6.1.0. |
| 4 | +--- |
| 5 | + |
| 6 | +# Migrating Pester tests |
| 7 | + |
| 8 | +Use the reusable [`pester-migration`](https://github.com/PSModule/Process-PSModule/tree/main/skills/pester-migration/SKILL.md) |
| 9 | +agent skill to migrate every Pester test set in a PSModule repository. It is |
| 10 | +written for Pester **6.1.0** and distinguishes required compatibility changes |
| 11 | +from optional v6 modernization. |
| 12 | + |
| 13 | +The migration covers repository and test-set inventory, supported PowerShell |
| 14 | +runtime and CI checks, per-file discovery and run isolation, hidden paths, |
| 15 | +data-driven tests, setup blocks, mocks, pending tests, name templates, |
| 16 | +coverage, `Invoke-Pester` configuration, reserved tags, and validation |
| 17 | +reporting. It does not migrate consumer repositories as part of this framework |
| 18 | +change. |
| 19 | + |
| 20 | +## Required before declaring a migration complete |
| 21 | + |
| 22 | +- Every test entry point is inventoried and runs on its supported runtime matrix. |
| 23 | +- Pester 6.1.0 is imported in local and CI acceptance runs. |
| 24 | +- Each test file is self-contained under per-file discovery and run. |
| 25 | +- Hidden paths, empty data, duplicate setup blocks, mocks, pending tests, name |
| 26 | + templates, coverage settings, legacy invocation parameters, and `None` tags |
| 27 | + have been reviewed. |
| 28 | +- Serial results, coverage, and test-result artifacts are recorded and compared |
| 29 | + with the baseline. |
| 30 | + |
| 31 | +## Optional after compatibility |
| 32 | + |
| 33 | +`Should-*` assertions, `Run.Shuffle`, and experimental `Run.Parallel` are |
| 34 | +independent adoption choices. Enable them only with separate validation and |
| 35 | +document the choice. |
| 36 | + |
| 37 | +## Primary and secondary sources |
| 38 | + |
| 39 | +- [Official Pester v5-to-v6 migration](https://pester.dev/docs/migrations/v5-to-v6) |
| 40 | +- [Pester installation](https://pester.dev/docs/introduction/installation) |
| 41 | +- [Pester configuration](https://pester.dev/docs/usage/configuration) |
| 42 | +- [Pester parallel execution](https://pester.dev/docs/usage/parallel) |
| 43 | +- [Awesome Copilot pester-migration](https://github.com/github/awesome-copilot/tree/main/skills/pester-migration) |
| 44 | +- [Awesome Copilot pester-should-migration](https://github.com/github/awesome-copilot/tree/main/skills/pester-should-migration) |
0 commit comments