Skip to content

Commit 0458a6b

Browse files
HeyItsGilbertclaude
andcommitted
fix(tests): correct Help test variable names and remove duplicate changelog path line
- Use $commandParameterNames (not undefined $parameterNames) in the help-parameter-in-code assertion - Populate $helpParameterNames in BeforeDiscovery so Context -ForEach actually iterates during discovery (was silently empty with BeforeAll) - Remove duplicate $changelogPath assignment that used the wrong -Child alias Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7e72ea5 commit 0458a6b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Tests/Help.tests.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Describe "Test help for <_.Name>" -ForEach $commands {
4242
$commandHelp = Get-Help $command.Name -ErrorAction SilentlyContinue
4343
$commandParameters = global:FilterOutCommonParams -Params $command.ParameterSets.Parameters
4444
$commandParameterNames = $commandParameters.Name
45+
$helpParameters = global:FilterOutCommonParams -Params $commandHelp.Parameters.Parameter
46+
$helpParameterNames = $helpParameters.Name
4547
# $helpLinks = $commandHelp.relatedLinks.navigationLink.uri
4648
}
4749

@@ -110,7 +112,7 @@ Describe "Test help for <_.Name>" -ForEach $commands {
110112

111113
# Shouldn't find extra parameters in help.
112114
It "finds help parameter in code: <_>" {
113-
$_ -in $parameterNames | Should -Be $true
115+
$_ -in $commandParameterNames | Should -Be $true
114116
}
115117
}
116118
}

Tests/Manifest.tests.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ BeforeAll {
1010
$outputManifestPath = Join-Path -Path $outputModVerDir -Child "$($moduleName).psd1"
1111
$manifestData = Test-ModuleManifest -Path $outputManifestPath -Verbose:$false -ErrorAction Stop -WarningAction SilentlyContinue
1212

13-
$changelogPath = Join-Path -Path $env:BHProjectPath -Child 'CHANGELOG.md'
1413
$changelogPath = Join-Path -Path $env:BHProjectPath -ChildPath 'CHANGELOG.md'
1514
$changelogLine = Get-Content -Path $changelogPath | Where-Object { $_ -match "^##\s\[(?<Version>(\d+\.){1,3}\d+)\]" } | Select-Object -First 1
1615
$changelogVersion = if ($changelogLine -and ($changelogLine -match "^##\s\[(?<Version>(\d+\.){1,3}\d+)\]")) { $matches.Version } else { $null }

0 commit comments

Comments
 (0)