Pester 测试迁移
原名:pester-migration
把旧版 PowerShell Pester 测试逐步迁移到当前语法和执行模型。
中文 Skills 技能说明
适合 Windows 自动化项目升级测试体系。先固定原有行为和通过基线,再分批转换 Mock、断言和生命周期;迁移不自动授权执行会修改系统或生产环境的脚本。
上游能力依据
上游原始适用说明:Pester migration skill for upgrading PowerShell Pester test suites across major versions — v3→v4, v4→v5, and v5→v6. Covers the Discovery/Run two-phase model, moving setup into BeforeAll, $PSScriptRoot vs $MyInvocation, mock changes (Assert-MockCalled → Should -Invoke, removed fall-through), Invoke-Pester parameters → PesterConfiguration, data-driven -ForEach/-TestCases, and the v6 breaking changes. Use when the user asks to upgrade, migrate, or modernize Pester tests, fix .Tests.ps1 files that broke after bumping the Pester version, or convert legacy Should / Invoke-Pester syntax.
上游 SKILL.md 主要章节(保留原文标题):
- References
- Step 0 — Detect where you are and where you're going
- Migration workflow
- What actually changes (scope per jump)
- Quick cheat sheets
- v4 → v5 (most common fixes)
- v5 → v6 (most common fixes)
- Safety rules
使用边界
先复现问题并固定测试范围,再生成或执行测试。测试通过只能证明已覆盖的场景,不能代替生产环境验收。
作者、翻译与许可证
- 原作者
- GitHub, Inc. 与 awesome-copilot contributors
- 中文翻译
- CEOFans翻译
- 许可证
- MIT
- 上游来源
- https://github.com/github/awesome-copilot/tree/3f0bba475ec40b9680e1d0311b9caffeec5ad4c3/skills/pester-migration
适用范围
平台:linux、macos、windows;标签:测试与质量、Pester 测试迁移
安全提示
基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。
如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。