chore: Pin Pester 6.0.0 for the repository test suite#132
Merged
Conversation
Move the repository's own test suite from Pester 5.8.0 to 6.0.0, pinned exactly in requirements.psd1 (#17 records the targeting decision). This is a development-dependency change only: the shipped module's Pester compatibility contract (Test-PSBuildPester imports Pester with a 5.0.0 minimum) is unchanged. Pester 6 fails discovery on an empty -ForEach collection instead of silently generating nothing, which broke tests/Help.tests.ps1 for commands whose help has no related links. Guard the three data-driven blocks (help links, command parameters, help parameter names) with discovery-time if checks, preserving the Pester 5 behavior on both versions. Full suite passes under 6.0.0: 301 passed, 0 failed, 15 skipped (Windows-only signing tests). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s development/test tooling to run the repo’s Pester test suite on a pinned Pester 6.0.0, and adjusts the help validation tests to avoid Pester 6 discovery failures when data-driven inputs are empty.
Changes:
- Pin repository test dependency from Pester 5.8.0 to 6.0.0 in
requirements.psd1. - Add discovery-time guards to data-driven blocks in
tests/Help.tests.ps1intended to preserve Pester 5 behavior when-ForEachinputs are empty. - Update contributor/testing documentation and
CHANGELOG.mdto reflect the pinned Pester 6.0.0 decision.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/Help.tests.ps1 |
Adds discovery-time guards around data-driven help tests to avoid Pester 6 empty-collection discovery failures. |
requirements.psd1 |
Pins Pester dependency to 6.0.0 for the repository’s build/test bootstrap. |
instructions/repository-specific.instructions.md |
Updates testing guidance to reflect Pester 6.0.0 and assertion-style expectations. |
CHANGELOG.md |
Records the dependency targeting change under Unreleased. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address review feedback on #132: the "help parameter in code" Context consumed $helpParameterNames at discovery time, but the variable was only assigned in BeforeAll (run phase), so the block never generated any tests under Pester 5 or 6. Compute $helpParameters and $helpParameterNames in BeforeDiscovery, matching the other data-driven blocks. Also fix the assertion inside it, which referenced the undefined $parameterNames instead of $commandParameterNames - a latent bug that never surfaced because the block never ran. Reactivating the block adds 66 assertions: 367 passed, 0 failed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
The changelog documents user-facing changes to the shipped module; which Pester version this repository's own test suite runs on is a contributor-facing concern and is already covered by the repository instructions and #17. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
CHANGELOG.md documents user-facing changes to the shipped module only; repository-internal changes (dev dependencies, CI, repo build scripts, test suite) get no entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
requirements.psd1(the targeting decision and its guardrails are recorded on Additional Pester tests needed #17)-ForEachcollection instead of silently generating nothing, which killed the wholetests/Help.tests.ps1container becauseBuild-PSBuildMAMLHelphas no related help links. The three data-driven blocks (help links, command parameters, help parameter names) are now guarded with discovery-timeifchecks that preserve the Pester 5 behavior and remain valid on both versions$helpParameters/$helpParameterNamesduring discovery so the help-parameter Context actually generates tests (it had never produced any — the variables were only assigned at run time), and fix the undefined$parameterNamesreference inside it. Reactivating the block added 66 passing assertionsThis is a development-dependency change only, so there is no changelog entry (changelog is reserved for user-facing changes to the shipped module). The shipped module's Pester compatibility contract is untouched:
Test-PSBuildPesterstill imports Pester with a 5.0.0 minimum and the manifest still declares Pester 5.x support.Noteworthy: before the guard fix, the dead
Help.tests.ps1container was reported by Pester (Container failed: 1) but the build still exited 0 and psake reported success — a live occurrence of the failure-gate gap fixed in #128 (repo build file) and #133 (shipped function).Test Plan
./build.ps1 -Bootstrap -Task Testinstalls Pester 6.0.0 via PSDepend and runs green locally (Linux, PowerShell 7.6): 367 passed, 0 failed, 15 skipped (Windows-only signing tests), no failed containersHelp.tests.ps1fixes the same run reported 59 passed + 1 failed container, confirming the guards unlocked the per-command help tests rather than skipping themBreaking Changes
None for module consumers. Contributors running this repo's test suite will get Pester 6.0.0 installed by
./build.ps1 -Bootstrap.🤖 Generated with Claude Code
https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa