ps/Modules/Alkami.PowerShell.Configuration/Public/Set-HelmDeploymentVersions.tests.ps1

26 lines
1.3 KiB
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
. $PSScriptRoot\..\..\Load-PesterModules.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.tests\.', '.'
$functionPath = Join-Path -Path $here -ChildPath $sut
Write-Host "Overriding SUT: $functionPath"
Import-Module $functionPath -Force
$moduleForMock = ""
Describe "Set-HelmDeploymentVersions" {
Mock -ModuleName $moduleForMock -CommandName Get-LogLeadName -MockWith {}
Mock -ModuleName $moduleForMock -CommandName Test-IsCollectionNullOrEmpty -MockWith {}
Mock -ModuleName $moduleForMock -CommandName Write-Warning -MockWith {}
Mock -ModuleName $moduleForMock -CommandName Get-HelmApplicationYamls -MockWith {}
Mock -ModuleName $moduleForMock -CommandName Write-Error -MockWith {}
Mock -ModuleName $moduleForMock -CommandName ConvertTo-Yaml -MockWith {}
Mock -ModuleName $moduleForMock -CommandName Write-Host -MockWith {}
Context "It does not error when Packages is null" {
It "Does not throw" {
{ Set-HelmDeploymentVersions -RepoPath "TestDrive:\" -EnvironmentName "pester" } | Should Not Throw
}
It "Returns an empty result set" {
Set-HelmDeploymentVersions -RepoPath "TestDrive:\" -EnvironmentName "pester" | Should BeNullOrEmpty
}
}
}