Skip to content

Commit

Permalink
module validation psd1 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jworkmanjc committed Sep 29, 2023
1 parent 9399f2c commit 896b9b3
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
Describe -Tag:('ModuleValidation') 'Module Manifest Tests' {
It ('Passes Test-ModuleManifest') {
Test-ModuleManifest -Path:("$PesterParams_ModuleManifestPath/$PesterParams_ModuleManifestName") | Should -Not -BeNullOrEmpty
$? | Should -Be true
$module = Test-ModuleManifest -Path:("$FilePath_psd1")
# validate module
$module.RootModule | Should -Be "JumpCloud.psm1"
$module.Author | Should -Be "JumpCloud Solutions Architect Team"
$module.CompanyName | Should -Be "JumpCloud"
$module.Copyright | Should -Be "(c) JumpCloud. All rights reserved."
$module.Description | Should -Be "PowerShell functions to manage a JumpCloud Directory-as-a-Service"

# validate required Modules
$RequiredModules = @('JumpCloud.SDK.DirectoryInsights', 'JumpCloud.SDK.V1', 'JumpCloud.SDK.V2')
$RequiredModules | ForEach-Object {
write-host "$_"
$module.RequiredModules.Name | should -Contain $_
}

# Validate module version
$latestModule = Find-Module -Name JumpCloud
$module.Version | should -BeGreaterThan $latestModule.version
}
}

0 comments on commit 896b9b3

Please sign in to comment.