Skip to content

Commit c47584b

Browse files
Reproduce projected resolver tag collection metadata
(cherry picked from commit b367050)
1 parent 085036b commit c47584b

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎.github/actions/Publish-PSModule/tests/Publish-PSModule.Preflight.Tests.ps1‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,23 @@ Describe 'Publish-PSModule source-bound preflight' {
243243
$response.Value.Count | Should -Be 0
244244
}
245245

246+
It 'rejects a scalar tag enumeration instead of projecting a discovery collection' {
247+
$script:state.ApiResponses['repos/PSModule/TestModule/git/matching-refs/tags/'] = [pscustomobject]@{
248+
ref = 'refs/tags/v1.2.4'
249+
object = [pscustomobject]@{ type = 'commit'; sha = $env:GITHUB_SHA }
250+
}
251+
$reader = Get-PSModulePublicationReader -Repository 'PSModule/TestModule' -ReadOnly
252+
253+
{ & $reader.GetTagList } | Should -Throw '*collection metadata*'
254+
}
255+
256+
It 'retains a verified empty discovery collection for a new module' {
257+
$script:state.ApiResponses['repos/PSModule/TestModule/git/matching-refs/tags/'] = @()
258+
$reader = Get-PSModulePublicationReader -Repository 'PSModule/TestModule' -ReadOnly
259+
260+
@(& $reader.GetTagList).Count | Should -Be 0
261+
}
262+
246263
It 'rejects a Gallery-only package with no source and artifact proof' {
247264
$script:state.Package = [pscustomobject]@{ Name = 'TestModule'; Version = '1.2.4' }
248265

0 commit comments

Comments
 (0)