Skip to content

Document the piped-collection assertion hint for v6#383

Merged
nohwnd merged 2 commits into
mainfrom
nohwnd-docs-piped-collection-hint-v6
Jun 29, 2026
Merged

Document the piped-collection assertion hint for v6#383
nohwnd merged 2 commits into
mainfrom
nohwnd-docs-piped-collection-hint-v6

Conversation

@nohwnd

@nohwnd nohwnd commented Jun 29, 2026

Copy link
Copy Markdown
Member

Adds a ### Piping vs. -Actual`` subsection to the "New Should-* 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) as 1 and @() as $null, and a piped collection is re-collected as [object[]] (losing its original type such as [int[]]). The subsection shows how to use -Actual to 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.mdx is touched; the auto-generated docs/commands/Should-*.mdx files are left untouched.

Docs for pester/Pester#2806.

nohwnd and others added 2 commits June 29, 2026 23:04
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 nohwnd merged commit 640b1a5 into main Jun 29, 2026
4 checks passed
@nohwnd nohwnd deleted the nohwnd-docs-piped-collection-hint-v6 branch June 29, 2026 21:32
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant