Skip to content

Commit a5931c9

Browse files
committed
Add test
1 parent 728b5c6 commit a5931c9

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

test/InstallPSResourceTests/InstallPSResourceLocal.Tests.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ Describe 'Test Install-PSResource for local repositories' -tags 'CI' {
1414
BeforeAll {
1515
$localRepo = "psgettestlocal"
1616
$localUNCRepo = "psgettestlocal3"
17+
$localNupkgRepo = "LocalNupkgRepo"
18+
$localNupkgRepoUri = "test\testFiles\testNupkgs"
1719
$testModuleName = "test_local_mod"
1820
$testModuleName2 = "test_local_mod2"
1921
$testModuleClobber = "testModuleClobber"
2022
$testModuleClobber2 = "testModuleClobber2"
2123
Get-NewPSResourceRepositoryFile
2224
Register-LocalRepos
25+
Register-PSResourceRepository -Name $localNupkgRepo -SourceLocation $localNupkgRepoUri
2326

2427
$prereleaseLabel = "alpha001"
2528
$tags = @()
@@ -279,4 +282,13 @@ Describe 'Test Install-PSResource for local repositories' -tags 'CI' {
279282
$err[$i].FullyQualifiedErrorId | Should -Not -Be "System.NullReferenceException,Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource"
280283
}
281284
}
285+
286+
It "Install .nupkg that contains directories (specific package throws errors when accessed by ZipFile.OpenRead)" {
287+
$nupkgName = "Microsoft.Web.Webview2"
288+
$nupkgVersion = "1.0.2792.45"
289+
Install-PSResource -Name $nupkgName -Version $nupkgVersion -Repository $localNupkgRepo -TrustRepository
290+
$pkg = Get-InstalledPSResource $nupkgName
291+
$pkg.Name | Should -Be $nupkgName
292+
$pkg.Version | Should -Be $nupkgVersion
293+
}
282294
}
Binary file not shown.

0 commit comments

Comments
 (0)