fix module manifest update logic
This commit is contained in:
@ -18,4 +18,40 @@ Describe 'Update-ModuleMeta' {
|
||||
$foo.Description[0].Text.Length | Should -BeGreaterThan 5
|
||||
}
|
||||
}
|
||||
|
||||
Context 'Unit Tests' -Tag 'Unit' {
|
||||
BeforeAll {
|
||||
# Mock Drone env if its not present
|
||||
if (!$Env:DRONE) {
|
||||
$Env:DRONE = $true
|
||||
$Env:DRONE_BUILD_EVENT = 'tag'
|
||||
$Env:DRONE_SEMVER = '9.9.9-dev9'
|
||||
$Env:DRONE_SEMVER_SHORT = '9.9.9'
|
||||
$Env:DRONE_SEMVER_PRERELEASE = 'dev9'
|
||||
}
|
||||
Mock 'Get-RepoPath' -ModuleName 'DroneHelper' {
|
||||
return @{
|
||||
Src = @{
|
||||
Manifest = @{
|
||||
Item = @{
|
||||
FullName = './resources/MyModule.psd1'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
It 'Update test module manifest' {
|
||||
{ Update-ModuleMeta } | Should -Not -Throw
|
||||
}
|
||||
|
||||
It 'Updated manifest is valid' {
|
||||
{ Test-ModuleManifest -Path './resources/MyModule.psd1' } | Should -Not -Throw
|
||||
}
|
||||
|
||||
It 'External dependencies prop is untouched' {
|
||||
$d = Test-ModuleManifest -Path './resources/MyModule.psd1'
|
||||
$d.PrivateData.PSData.ExternalModuleDependencies.Count | Should -Be '2'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user