Commit e651a28
fix(tests): run the param-help check (populate vars in BeforeDiscovery) (#21)
* fix(tests): populate help-parameter vars + commandName in BeforeDiscovery so the param-help check runs
Propagates PowerShellModuleTemplate#35. The 'help parameter help' Context used
-Foreach $helpParameterNames with the variable set only in BeforeAll (run phase).
Pester evaluates -Foreach during DISCOVERY, so the collection was $null then and
the Context expanded to ZERO tests -- the 'no stale/extra parameters documented in
help' check was a silent no-op. Populate $helpParameters/$helpParameterNames (and
$commandName, used in the Context name) in BeforeDiscovery so the check actually runs.
Surgical fix on current main; the broader test-scaffolding alignment (this repo's
open style/align-test-scaffolding-with-template PR) remains separate.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(tests): use $commandParameterNames in the param-help assertion
This repo's older scaffolding had drifted: the param-help Context asserted against
$parameterNames, which is never defined (only $commandParameterNames exists). The
discovery-phase fix activates that Context, so correct the variable. Surfaced by
Copilot on ReScenePS #21.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 838114d commit e651a28
1 file changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
147 | 149 | | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
| 154 | + | |
| 155 | + | |
151 | 156 | | |
152 | 157 | | |
153 | 158 | | |
| |||
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
236 | | - | |
| 241 | + | |
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
0 commit comments