Last active
October 17, 2017 17:54
-
-
Save brantb/cc401620798613cb08a516674af9c828 to your computer and use it in GitHub Desktop.
Pester test suite for module manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ModuleManifestName = 'MyModuleName.psd1' | |
$ModuleManifestPath = "$PSScriptRoot\..\$ModuleManifestName" | |
Describe 'Module Manifest Tests' { | |
# Test-ModuleManifest is slooooooow for some reason :( | |
It 'Passes Test-ModuleManifest' -Skip { | |
Test-ModuleManifest -Path $ModuleManifestPath | |
$? | Should Be $true | |
} | |
$manifest = Get-Module -ListAvailable "$PSScriptRoot\..\" | |
# Test exported cmdlets | |
Get-Item -Path "$PSScriptRoot\..\Public\*.ps1" | % { | |
$expected = $_.BaseName | |
It "Exports a function named '$expected'" { | |
$manifest.ExportedFunctions.Keys -contains $expected | Should Be $true | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment