From 1f40464c8a6b7c6ba67b06da99b70012cdebec31 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 26 Jul 2026 02:43:15 +0200 Subject: [PATCH 1/3] Remove duplicate public help link test Canonical public help link validation now lives in Process-PSModule. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- tests/PublicHelpLinks.Tests.ps1 | 41 --------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 tests/PublicHelpLinks.Tests.ps1 diff --git a/tests/PublicHelpLinks.Tests.ps1 b/tests/PublicHelpLinks.Tests.ps1 deleted file mode 100644 index c97247f..0000000 --- a/tests/PublicHelpLinks.Tests.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.0.0'; MaximumVersion = '6.*' } - -[Diagnostics.CodeAnalysis.SuppressMessageAttribute( - 'PSUseDeclaredVarsMoreThanAssignments', '', - Justification = 'Required for Pester test discovery.' -)] -[CmdletBinding()] -param() - -$sourcePath = Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -ChildPath 'src' -$publicFunctionsPath = Join-Path -Path $sourcePath -ChildPath 'functions' -$publicFunctionsPath = Join-Path -Path $publicFunctionsPath -ChildPath 'public' -$testCases = Get-ChildItem -Path $publicFunctionsPath -Filter '*.ps1' -Recurse -File | - Sort-Object -Property FullName | - ForEach-Object { - $relativePath = [IO.Path]::GetRelativePath($publicFunctionsPath, $_.FullName) - $relativeDirectory = Split-Path -Path $relativePath -Parent - $documentationPath = if ($relativeDirectory) { - '{0}/{1}' -f ($relativeDirectory -replace '[\\/]', '/'), $_.BaseName - } else { - $_.BaseName - } - - @{ - DocumentationPath = $documentationPath - Path = $_.FullName - } - } - -Describe 'Public function help links' { - It 'puts the canonical documentation link first for ' -ForEach $testCases { - param($DocumentationPath, $Path) - - $content = Get-Content -Path $Path -Raw - $links = [regex]::Matches($content, '(?ms)^\s*\.LINK\s*\r?\n\s*(?\S+)') - - $links.Count | Should -BeGreaterThan 0 - $links[0].Groups['Uri'].Value | - Should -Be "https://psmodule.io/Domeneshop/Functions/$DocumentationPath/" - } -} From 4272ce40815e859a294a442f4f2b43bfc81a4dc0 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 26 Jul 2026 02:49:13 +0200 Subject: [PATCH 2/3] Remove template smoke-test command Domeneshop now exposes only commands backed by its real API functionality. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/functions/public/Get-PSModuleTest.ps1 | 44 ----------------------- tests/Get-PSModuleTest.Tests.ps1 | 26 -------------- 2 files changed, 70 deletions(-) delete mode 100644 src/functions/public/Get-PSModuleTest.ps1 delete mode 100644 tests/Get-PSModuleTest.Tests.ps1 diff --git a/src/functions/public/Get-PSModuleTest.ps1 b/src/functions/public/Get-PSModuleTest.ps1 deleted file mode 100644 index d8a806d..0000000 --- a/src/functions/public/Get-PSModuleTest.ps1 +++ /dev/null @@ -1,44 +0,0 @@ -function Get-PSModuleTest { - <# - .SYNOPSIS - Get a greeting for a supplied name. - - .DESCRIPTION - Return a simple greeting used to verify that the module imports and invokes exported commands. - - .EXAMPLE - Get-PSModuleTest -Name 'World' - - Get the greeting "Hello, World!". - - .INPUTS - None - - You can't pipe objects to Get-PSModuleTest. - - .OUTPUTS - System.String - - A greeting containing the supplied name. - - .NOTES - This command is retained as the module's baseline smoke-test command. - - .LINK - https://psmodule.io/Domeneshop/Functions/Get-PSModuleTest/ - - .LINK - https://github.com/PSModule/Domeneshop - #> - [OutputType([string])] - [CmdletBinding()] - param( - # The name to include in the greeting. - [Parameter(Mandatory)] - [ValidateNotNullOrEmpty()] - [ValidateScript({ -not [string]::IsNullOrWhiteSpace($_) })] - [string] $Name - ) - - "Hello, $Name!" -} diff --git a/tests/Get-PSModuleTest.Tests.ps1 b/tests/Get-PSModuleTest.Tests.ps1 deleted file mode 100644 index 557df8c..0000000 --- a/tests/Get-PSModuleTest.Tests.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.0.0'; MaximumVersion = '6.*' } - -[Diagnostics.CodeAnalysis.SuppressMessageAttribute( - 'PSReviewUnusedParameter', '', - Justification = 'Required for Pester tests' -)] -[Diagnostics.CodeAnalysis.SuppressMessageAttribute( - 'PSUseDeclaredVarsMoreThanAssignments', '', - Justification = 'Required for Pester tests' -)] -[CmdletBinding()] -param() - -Describe 'Get-PSModuleTest' { - BeforeAll { - . (Join-Path -Path $PSScriptRoot -ChildPath 'Domeneshop.TestSetup.ps1') - } - - It 'returns a greeting for the supplied name' { - Get-PSModuleTest -Name 'World' | Should -Be 'Hello, World!' - } - - It 'rejects a whitespace-only name' { - { Get-PSModuleTest -Name ' ' } | Should -Throw - } -} From 679837cef0993b0e2fa8ab2f593ea23035d8e5b7 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 26 Jul 2026 08:45:25 +0200 Subject: [PATCH 3/3] Remove repository-local layout and requirement tests These checks are now centralized in the shared Process-PSModule flow. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- tests/ModuleRequirements.Tests.ps1 | 29 ----------------------------- tests/TestLayout.Tests.ps1 | 30 ------------------------------ 2 files changed, 59 deletions(-) delete mode 100644 tests/ModuleRequirements.Tests.ps1 delete mode 100644 tests/TestLayout.Tests.ps1 diff --git a/tests/ModuleRequirements.Tests.ps1 b/tests/ModuleRequirements.Tests.ps1 deleted file mode 100644 index 66b153c..0000000 --- a/tests/ModuleRequirements.Tests.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.0.0'; MaximumVersion = '6.*' } - -[Diagnostics.CodeAnalysis.SuppressMessageAttribute( - 'PSUseDeclaredVarsMoreThanAssignments', '', - Justification = 'Required for Pester test discovery.' -)] -[CmdletBinding()] -param() - -$sourcePath = Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -ChildPath 'src' -$testCases = @( - @{ - RequiredVersions = @( - Get-ChildItem -Path $sourcePath -Filter '*.ps1' -Recurse -File | - Select-String -Pattern '^\s*#Requires\s+-Version\s+(?\S+)\s*$' | - ForEach-Object { $_.Matches[0].Groups['Version'].Value } | - Sort-Object -Unique - ) - } -) - -Describe 'Module requirements' { - It 'targets only the latest PowerShell LTS' -ForEach $testCases { - param($RequiredVersions) - - $RequiredVersions | Should -HaveCount 1 - $RequiredVersions[0] | Should -Be '7.6' - } -} diff --git a/tests/TestLayout.Tests.ps1 b/tests/TestLayout.Tests.ps1 deleted file mode 100644 index 28045e7..0000000 --- a/tests/TestLayout.Tests.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -#Requires -Modules @{ ModuleName = 'Pester'; ModuleVersion = '6.0.0'; MaximumVersion = '6.*' } - -[CmdletBinding()] -param() - -$sourcePath = Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -ChildPath 'src' -$publicFunctionsPath = Join-Path -Path $sourcePath -ChildPath 'functions/public' -$testCases = Get-ChildItem -Path $publicFunctionsPath -Filter '*.ps1' -Recurse | - ForEach-Object { - $relativePath = [IO.Path]::GetRelativePath($publicFunctionsPath, $_.FullName) - $group = Split-Path -Path $relativePath -Parent - $testFile = if ($group) { - "$group.Tests.ps1" - } else { - "$($_.BaseName).Tests.ps1" - } - @{ - FunctionName = $_.BaseName - TestFile = $testFile - TestPath = Join-Path -Path $PSScriptRoot -ChildPath $testFile - } - } - -Describe 'Public command test layout' { - It 'covers in ' -ForEach $testCases { - Test-Path -LiteralPath $TestPath -PathType Leaf | Should -BeTrue - Get-Content -LiteralPath $TestPath -Raw | - Should -Match ([regex]::Escape("Describe '$FunctionName'")) - } -}