Found by a whole-repository review. Three things about how the suite is built, none of which changes what it proves today.
The queued-answer boilerplate is copied everywhere
Tests that drive an interactive prompt do this:
$script:answers = @('2', '08:15,13:00', 'sat', '9:00')
$script:index = 0
Mock Read-Host { $script:answers[$script:index++] }
It appears near-verbatim in at least eight Describe blocks, with no automatic reset between tests. A test that forgets $script:index = 0 reads whatever the previous test left behind, and does so silently - it will usually still pass, on the wrong input.
One shared helper - set the queue, reset the counter, install the mock - removes both the repetition and the failure mode.
The registry tests write real keys
Get-FixedDriveWritePolicy's tests create keys under HKCU:\Software\DevDriveTests. Cleanup was fixed to remove the whole branch in AfterAll, and it does, but a killed run still leaves residue in the user's hive. Two tests in that very block prove that mocking Test-Path and Get-ItemProperty is enough to cover the paths that matter. Prefer the mocks.
Three different Pester floors
- the suite declares
#Requires Pester 5.0
- the pre-commit hook accepts any Pester 5 or newer
- CI pins 6.1.0
So a contributor on Pester 5.x can pass the hook and fail CI on behaviour that differs between the two. Pin the hook's floor to what CI actually runs, or say in AGENTS.md that the gap exists and what it costs.
Scope
dev_drive.Tests.ps1, .githooks/pre-commit, and possibly AGENTS.md.
Found by a whole-repository review. Three things about how the suite is built, none of which changes what it proves today.
The queued-answer boilerplate is copied everywhere
Tests that drive an interactive prompt do this:
It appears near-verbatim in at least eight
Describeblocks, with no automatic reset between tests. A test that forgets$script:index = 0reads whatever the previous test left behind, and does so silently - it will usually still pass, on the wrong input.One shared helper - set the queue, reset the counter, install the mock - removes both the repetition and the failure mode.
The registry tests write real keys
Get-FixedDriveWritePolicy's tests create keys underHKCU:\Software\DevDriveTests. Cleanup was fixed to remove the whole branch inAfterAll, and it does, but a killed run still leaves residue in the user's hive. Two tests in that very block prove that mockingTest-PathandGet-ItemPropertyis enough to cover the paths that matter. Prefer the mocks.Three different Pester floors
#RequiresPester 5.0So a contributor on Pester 5.x can pass the hook and fail CI on behaviour that differs between the two. Pin the hook's floor to what CI actually runs, or say in
AGENTS.mdthat the gap exists and what it costs.Scope
dev_drive.Tests.ps1,.githooks/pre-commit, and possiblyAGENTS.md.