You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 780422b
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .github/plugin/psmodule/skills/psmodule-pester-migration/SKILL.md
+22-21Lines changed: 22 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,15 +34,16 @@ Required compatibility work:
34
34
blocks in the same scope.
35
35
- Replace removed `Assert-MockCalled` and `Assert-VerifiableMock`.
36
36
- Add a default mock when a parameter-filtered mock must handle other calls.
37
-
- Review `<...>` name templates because their contents are now expressions.
37
+
- Review `<...>` name templates because Pester v6 evaluates their contents as
38
+
PowerShell expressions.
38
39
- Replace `Set-ItResult -Pending` with `-Inconclusive`, `-Skipped`, or
39
40
`It -Skip`.
40
41
- Review coverage tracer and output format settings.
41
42
- Replace removed v4-style `Invoke-Pester` parameters with
42
43
`New-PesterConfiguration`.
43
44
- Rename a real `None` tag; in v6 it is reserved for untagged tests.
44
45
45
-
Optional v6 adoption after compatibility is green:
46
+
Optional v6 adoption after the required compatibility checks pass:
46
47
47
48
- Convert classic `Should -Be` assertions to `Should-Be` commands
48
49
incrementally. Classic syntax remains supported.
@@ -84,7 +85,7 @@ For each test set, add an inventory row to the migration report:
84
85
| Baseline | Run command, result counts, known failures |
85
86
86
87
Use the inventory to find test sets that are not reachable from the default
87
-
workflow. A green workflow is not evidence that every test set was migrated.
88
+
workflow. A workflow that passes is not evidence that every test set was migrated.
88
89
89
90
## Test-state and data contract
90
91
@@ -146,7 +147,7 @@ Record fixture ownership and availability in the inventory:
146
147
| Shared service |`tests/BeforeAll.ps1`| Before module-local matrix | Deterministic run-scoped name |
147
148
| Cleanup state |`tests/AfterAll.ps1`| Always-run teardown | Same `TestData` and run identity |
148
149
149
-
Fail loudly when required data or state is absent. Do not use a broad
150
+
If required data or state is absent, fail the test. Do not use a broad
150
151
`try/catch`, an empty default, or an implicit import to turn a missing fixture
151
152
into a passing or skipped test.
152
153
@@ -168,16 +169,16 @@ For every consumer repository, trace and record these surfaces before editing:
168
169
|`Invoke-ScriptAnalyzer` integration | Publishes `PSModuleLint-*` results alongside test results | Treat lint suites as required result artifacts, not Pester test files |
169
170
| Repository linter | Checks repository/workflow/Markdown files independently of Pester | Include skill and documentation paths in the repository lint inventory |
170
171
171
-
The current Process-PSModule flow specifically downloads the built module and
172
-
imports it before module-local tests, while `Test-PSModule` resolves source or
173
-
module paths for framework suites. The framework's own importability and
174
-
manifest tests may import/remove the module because import is their subject;
175
-
ordinary consumer tests must not copy that pattern as setup.
172
+
Process-PSModule downloads the built module and imports it before module-local
173
+
tests. `Test-PSModule` resolves source or module paths for framework suites. The
174
+
framework's own importability and manifest tests may import or remove the module
175
+
because import is their subject. Ordinary consumer tests must not copy that
176
+
pattern as setup.
176
177
177
178
Record the `PSModule/Invoke-Pester` action revision separately from the Pester
178
-
module version. The current Process-PSModule workflows reference that action at
179
-
`v5.1.0`; its revision and its Pester installation policy must both be checked
180
-
when adopting Pester 6.1.0. Updating one does not prove that the other changed.
179
+
module version. When adopting Pester 6.1.0, check both the action revision and its
180
+
Pester installation policy. This includes workflows that reference `v5.1.0`.
181
+
Updating one does not prove that the other changed.
181
182
182
183
Use this per-repository checklist:
183
184
@@ -322,8 +323,8 @@ Should -Invoke Get-Thing -Times 1 -Exactly
322
323
Should -InvokeVerifiable
323
324
```
324
325
325
-
In v6, a call that matches no `-ParameterFilter`no longer falls through to
326
-
the real command. Add an unfiltered default mock when other calls are valid:
326
+
In v6, a call that matches no `-ParameterFilter`does not run the real command.
327
+
Add an unfiltered default mock when other calls are valid:
327
328
328
329
```powershell
329
330
Mock Get-Thing { 'default' }
@@ -348,8 +349,8 @@ should be reported for follow-up.
348
349
349
350
### Name templates
350
351
351
-
In v6, every `<...>` token in a `Describe`, `Context`, or `It` name is
352
-
evaluated as a PowerShell expression in the test scope. Review arithmetic,
352
+
In v6, Pester evaluates every `<...>` token in a `Describe`, `Context`, or `It`
353
+
name as a PowerShell expression in the test scope. Review arithmetic,
353
354
method calls, and expressions that were literal in v5. Escape a leading `<`
354
355
when literal text is intended:
355
356
@@ -368,15 +369,15 @@ filters and reports.
368
369
### Coverage
369
370
370
371
Pester 6 uses the Profiler tracer by default and `CodeCoverage.UseBreakpoints`
371
-
defaults to `$false`. Keep the new default unless compatibility with historical
372
-
coverage numbers requires:
372
+
defaults to `$false`. Keep this default. If compatibility with earlier coverage
373
+
numbers requires breakpoints, use:
373
374
374
375
```powershell
375
376
$config.CodeCoverage.UseBreakpoints = $true
376
377
```
377
378
378
379
`CoverageGutters` is removed. Use `JaCoCo` or `Cobertura`; coverage paths are
0 commit comments