. $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 } } }