Document the piped-collection assertion hint for v6#383
Merged
Conversation
Add a "Piping vs. -Actual" subsection to the v5-to-v6 migration guide explaining that the new Should-* assertions take their actual value from the pipeline (which unwraps and re-collects collections as [object[]]) or from -Actual, and showing the failure-path hint that points users back to -Actual. Docs for pester/Pester#2806. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The pipeline can't reliably distinguish a single-item collection from a scalar, and a collection's original type isn't visible on the right-hand side of the pipeline. Pester recovers the piped value through tricks that work for common cases but not every one, so the hint won't always appear; recommend -Actual when the exact value or collection type matters. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nohwnd
added a commit
that referenced
this pull request
Jun 29, 2026
Integrate main's v6 docs updates (PRs #379-#383, incl. MDX-escaping in the config generator and new usage pages) with this branch's docs-generation fix. Re-applied on top of the merge: - Keep Run.RepoRoot rendered as the illustrative placeholder C:\MyProject (and preamble Run.Path examples as C:\MyProject\tests). - Regenerate command reference on PowerShell 7.4+ and drop both the spurious ProgressAction common parameter and the [<CommonParameters>] SYNTAX token. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Adds a
### Piping vs.-Actual`` subsection to the "NewShould-*assertions (optional)" section of the v5-to-v6 migration guide.It explains that the new
Should-*assertions take their actual value either from the pipeline or from-Actual. Because the pipeline unwraps its input, a value assertion sees@(1)as1and@()as$null, and a piped collection is re-collected as[object[]](losing its original type such as[int[]]). The subsection shows how to use-Actualto preserve the exact value or concrete collection type, and documents the new failure-path hint that explains what happened and points users back to-Actual.Only
docs/migrations/v5-to-v6.mdxis touched; the auto-generateddocs/commands/Should-*.mdxfiles are left untouched.Docs for pester/Pester#2806.