Problem description
PR #560 added unit tests in tests/Unit/Public/New-SampleModule.tests.ps1 that replace Invoke-Plaster with a hand-maintained stub listing every Plaster parameter statically. The stub is required because Invoke-Plaster declares manifest-driven parameters via dynamicparam, which Pester's auto-generated mock proxy cannot model.
When a new Use* toggle or parameter is added to Sampler/Templates/Sampler/plasterManifest.xml, the stub will silently drop it — $PSBoundParameters will not contain it and the tests will keep passing while real scaffolding behavior regresses.
Verbose logs
N/A
How to reproduce
- Add a new
<parameter name="UseSomething" ...> entry to Sampler/Templates/Sampler/plasterManifest.xml.
- Do not update the stub in
tests/Unit/Public/New-SampleModule.tests.ps1.
- Run
./build.ps1 -Tasks test -PesterPath 'tests/Unit/Public/New-SampleModule.tests.ps1' -CodeCoverageThreshold 0.
- Observe that tests pass even though the stub does not accept the new parameter.
Expected behavior
A test fails when the stub's param() block is out of sync with the parameters defined in plasterManifest.xml.
Current behavior
No such check exists; drift is silent.
Suggested solution
Add a lightweight guard test under tests/Unit/Public/ that:
- Parses
Sampler/Templates/Sampler/plasterManifest.xml.
- Enumerates
<parameter name="..."> nodes.
- Asserts every name is present in
(Get-Command Invoke-Plaster).Parameters.Keys within InModuleScope.
Consider also documenting the stub pattern in .github/instructions/test-writing.instructions.md.
Operating system the target node is running
N/A
PowerShell version and build the target node is running
N/A
Module version used
Sampler Unreleased / post-#560.
Problem description
PR #560 added unit tests in
tests/Unit/Public/New-SampleModule.tests.ps1that replaceInvoke-Plasterwith a hand-maintained stub listing every Plaster parameter statically. The stub is required becauseInvoke-Plasterdeclares manifest-driven parameters viadynamicparam, which Pester's auto-generated mock proxy cannot model.When a new
Use*toggle or parameter is added toSampler/Templates/Sampler/plasterManifest.xml, the stub will silently drop it —$PSBoundParameterswill not contain it and the tests will keep passing while real scaffolding behavior regresses.Verbose logs
N/A
How to reproduce
<parameter name="UseSomething" ...>entry toSampler/Templates/Sampler/plasterManifest.xml.tests/Unit/Public/New-SampleModule.tests.ps1../build.ps1 -Tasks test -PesterPath 'tests/Unit/Public/New-SampleModule.tests.ps1' -CodeCoverageThreshold 0.Expected behavior
A test fails when the stub's
param()block is out of sync with the parameters defined inplasterManifest.xml.Current behavior
No such check exists; drift is silent.
Suggested solution
Add a lightweight guard test under
tests/Unit/Public/that:Sampler/Templates/Sampler/plasterManifest.xml.<parameter name="...">nodes.(Get-Command Invoke-Plaster).Parameters.KeyswithinInModuleScope.Consider also documenting the stub pattern in
.github/instructions/test-writing.instructions.md.Operating system the target node is running
N/A
PowerShell version and build the target node is running
N/A
Module version used
Sampler
Unreleased/ post-#560.