Skip to content

Commit

Permalink
Added a test to check module version and help version against project…
Browse files Browse the repository at this point in the history
… version, #49
  • Loading branch information
jeffpatton1971 committed Jan 2, 2024
1 parent e4708bc commit 75375b3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Pipelines/Tests/CmdletTests/Pipeline.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
BeforeAll {
# Define the path to the module and the help info file
$modulePath = (Get-Item .\Pipelines.psd1).FullName
$helpInfoPath = (Get-Item .\cabs\Pipelines_cff00216-d0d0-4565-af27-31d9c0400884_HelpInfo.xml).FullName
$projectVersionFilePath = (Get-Item .\Pipelines\Pipelines.csproj).FullName

# Read the project version
[xml]$project = Get-Content $projectVersionFilePath -Raw
$projectVersion = $project.Project.PropertyGroup.Version;

# Import the module manifest
$moduleManifest = Import-PowerShellDataFile -Path $modulePath

[xml]$helpInfo = Get-Content -Path $helpInfoPath
$helpVersion = $helpInfo.HelpInfo.SupportedUICultures.UICulture.UICultureVersion
}

Describe 'Module Version Checks' {
It 'Module manifest version should match project version' {
$moduleManifest['ModuleVersion'] | Should -BeExactly $projectVersion
}

It 'HelpInfo.xml version should match project version' {
$helpVersion | Should -BeExactly $projectVersion
}
}

0 comments on commit 75375b3

Please sign in to comment.