Skip to content

Commit

Permalink
more windows tests (#5740)
Browse files Browse the repository at this point in the history
  • Loading branch information
timmy-wright authored Feb 4, 2025
1 parent f0e4a05 commit 4bcbbdb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vhdbuilder/packer/windows/components_json_helpers.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ Describe 'Gets the Binaries' {
$packages | ConvertTo-Json -Compress | Should -Be "{}"
}

It 'given the windows block is missing, it returns an empty array' {
$componentsJson.Packages[0].downloadUris.windows = $null

$packages = GetPackagesFromComponentsJson $componentsJson

$packages | ConvertTo-Json -Compress | Should -Be "{}"
}

It 'given there are no windows versions, it returns an empty array' {
$componentsJson.Packages[0].downloadUris.windows = @()

Expand Down Expand Up @@ -206,6 +214,14 @@ Describe 'Gets The Versions' {
$components | Should -Be @()
}

It 'given the windowsVersions block is missing, it returns an empty array' {
$componentsJson.ContainerImages[0].windowsVersions = $null

$components = GetComponentsFromComponentsJson $componentsJson

$components | Should -Be @()
}

It 'given there is a latest version, it returns that version' {
$componentsJson.ContainerImages[0].windowsVersions = @(
[PSCustomObject]@{
Expand Down

0 comments on commit 4bcbbdb

Please sign in to comment.