Skip to content

Instantly share code, notes, and snippets.

@brantb
Last active October 17, 2017 17:54
Show Gist options
  • Save brantb/cc401620798613cb08a516674af9c828 to your computer and use it in GitHub Desktop.
Save brantb/cc401620798613cb08a516674af9c828 to your computer and use it in GitHub Desktop.
Pester test suite for module manifest
$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