add refs for pester test

This commit is contained in:
OCram85 2018-03-08 11:04:58 +01:00
parent 0dae01d141
commit 64a242c1d3
6 changed files with 18 additions and 2 deletions

View File

@ -0,0 +1,15 @@
$RepoRoot = (Get-GitDirectory).replace('\.git', '')
Describe "Pre-Flight module tests" {
$ManifestFilePath = "{0}\src\PSCredentialstore.psd1" -f $RepoRoot
Context "Manifest file related" {
It "Test the parsed file itsef" {
{ Test-ModuleManifest -Path $ManifestFilePath } | Should -Not -Throw
}
}
Context "Module consistency tests" {
IT "Importing should work" {
{ Import-Module -Name $ManifestFilePath -Global } | Should -Not -Throw
}
}
}

View File

@ -14,7 +14,8 @@ Else {
} }
# load additional functions defined in the repository. Replace the expression <FunctionName>. # load additional functions defined in the repository. Replace the expression <FunctionName>.
#. (Get-ChildItem -Path $RepoRoot -Filter "<FunctionName>.ps1" -Recurse).FullName . (Get-ChildItem -Path $RepoRoot -Filter "Get-ModuleBase.ps1" -Recurse).FullName
. (Get-ChildItem -Path $RepoRoot -Filter "Test-Module.ps1" -Recurse).FullName
#endregion HEADER #endregion HEADER
Describe "Resolve-Dependency" { Describe "Resolve-Dependency" {
@ -25,7 +26,7 @@ Describe "Resolve-Dependency" {
{ Resolve-Dependency -Name 'foobar2000' } | Should -Not -Throw { Resolve-Dependency -Name 'foobar2000' } | Should -Not -Throw
} }
It "Test2: Output type should be bool" { It "Test2: Output type should be bool" {
Resolve-Dependency -Name 'foobar2000' | Should -BeOfType system.bool Resolve-Dependency -Name 'foobar2000' | Should -BeOfType bool
} }
} }
} }