Prepare next release 0.2.1.X #18
15
tests/00_BasicModule.Tests.ps1
Normal file
15
tests/00_BasicModule.Tests.ps1
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user