mirror of
https://github.com/github/awesome-copilot.git
synced 2026-05-28 09:31:44 +00:00
Clarify that Set-ItResult ends the It block in Pester v5 Skip section (#1857)
Set-ItResult -Skipped/-Inconclusive throws internally to end the It block, so code after it does not run and a trailing return is unreachable. Documenting this prevents the recurring suggestion to add a redundant return after Set-ItResult. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -121,6 +121,7 @@ Invoke-Pester -TagFilter 'Unit' -ExcludeTagFilter 'Slow'
|
||||
- **`-Skip`**: Available on `Describe`, `Context`, and `It` to skip tests
|
||||
- **Conditional**: Use `-Skip:$condition` for dynamic skipping
|
||||
- **Runtime Skip**: Use `Set-ItResult -Skipped` during test execution (setup/teardown still run)
|
||||
- **Ends the test body**: `Set-ItResult -Skipped`/`-Inconclusive` throws internally to end the `It` block, so code after it does not run; a trailing `return` is unreachable and should not be added
|
||||
|
||||
```powershell
|
||||
It 'Should work on Windows' -Skip:(-not $IsWindows) { }
|
||||
|
||||
Reference in New Issue
Block a user