Skip to content

Commit

Permalink
Update publish local tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alerickson committed Oct 29, 2024
1 parent 9e5e287 commit bb87962
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions test/PublishPSResourceTests/PublishPSResource.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,20 @@ Describe "Test Publish-PSResource" -tags 'CI' {
$dependencyVersion = "2.0.0"
New-ModuleManifest -Path (Join-Path -Path $script:DependencyModuleBase -ChildPath "$script:DependencyModuleName.psd1") -ModuleVersion $dependencyVersion -Description "$script:DependencyModuleName module"

Publish-PSResource -Path $script:DependencyModuleBase
Publish-PSResource -Path $script:DependencyModuleBase -Repository $testRepository2
$pkg1 = Find-PSResouce $script:DependencyModuleName -Repository $testRepository2
$pkg1 | Should -Not -BeNullOrEmpty
$pkg1.Version | Should -Be $dependencyVersion

# Create module to test
$version = "1.0.0"
New-ModuleManifest -Path (Join-Path -Path $script:PublishModuleBase -ChildPath "$script:PublishModuleName.psd1") -ModuleVersion $version -Description "$script:PublishModuleName module" -RequiredModules @(@{ModuleName = 'PackageManagement'; ModuleVersion = '2.0.0' })

Publish-PSResource -Path $script:PublishModuleBase
Publish-PSResource -Path $script:PublishModuleBase -Repository $testRepository2

$nupkg = Get-ChildItem $script:repositoryPath | select-object -Last 1
$nupkg.Name | Should -Be "$script:PublishModuleName.$version.nupkg"
$pkg2 = Find-PSResouce $script:DependencyModuleName -Repository $testRepository2
$pkg2 | Should -Not -BeNullOrEmpty
$pkg2.Version | Should -Be $dependencyVersion
}

It "Publish a module with a dependency that is not published, should throw" {
Expand Down Expand Up @@ -685,7 +689,7 @@ Describe "Test Publish-PSResource" -tags 'CI' {
$expectedPath = Join-Path -Path $script:repositoryPath2 -ChildPath "$ParentModuleName.$ParentVersion.nupkg"
(Get-ChildItem $script:repositoryPath2).FullName | Should -Contain $expectedPath
}

<#
It "Publish a module with required modules (both in string format and hashtable format)" {
# look at functions in test utils for creating a module with prerelease
$ModuleName = "ParentModule"
Expand Down Expand Up @@ -720,4 +724,5 @@ Describe "Test Publish-PSResource" -tags 'CI' {
$expectedPath = Join-Path -Path $script:repositoryPath2 -ChildPath "$ModuleName.$ModuleVersion.nupkg"
(Get-ChildItem $script:repositoryPath2).FullName | Should -Contain $expectedPath
}
#>
}

0 comments on commit bb87962

Please sign in to comment.