Skip to content

Commit

Permalink
add test for local repo with 4 digit and prerelease version
Browse files Browse the repository at this point in the history
  • Loading branch information
anamnavi committed Oct 30, 2024
1 parent f9e3d57 commit 342ccfd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/FindPSResourceTests/FindPSResourceLocal.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' {
$commandName = "cmd1"
$dscResourceName = "dsc1"
$prereleaseLabel = ""
$localNupkgRepo = "localNupkgRepo"
Get-NewPSResourceRepositoryFile
Register-LocalRepos
Register-LocalTestNupkgsRepo

$localRepoUriAddress = Join-Path -Path $TestDrive -ChildPath "testdir"
$tagsEscaped = @("'Test'", "'Tag2'", "'PSCommand_$cmdName'", "'PSDscResource_$dscName'")
Expand Down Expand Up @@ -319,4 +321,14 @@ Describe 'Test Find-PSResource for local repositories' -tags 'CI' {
$err.Count | Should -Not -Be 0
$err[0].FullyQualifiedErrorId | Should -BeExactly "FindTagsPackageNotFound,Microsoft.PowerShell.PSResourceGet.Cmdlets.FindPSResource"
}

It "find package where prerelease label includes digits and period (i.e prerelease label is not just words)" {
$nupkgName = "WebView2.Avalonia"
$nupkgVersion = "1.0.1518.46"
$prereleaseLabel = "preview.230207.17"
$res = Find-PSResource -Name $nupkgName -Prerelease -Repository $localNupkgRepo
$res.Name | Should -Be $nupkgName
$res.Version | Should -Be $nupkgVersion
$res.Prerelease | Should -Be $prereleaseLabel
}
}
Binary file not shown.

0 comments on commit 342ccfd

Please sign in to comment.