Skip to content

Commit b40337d

Browse files
committed
🧪 Add GitHub Packages Test
1 parent aa06dee commit b40337d

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

ModuleFast.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#requires -version 7.2
1+
#requires -version 7.2 -Modules Microsoft.Powershell.SecretManagement
22
using namespace Microsoft.PowerShell.Commands
33
using namespace System.Management.Automation
44
using namespace System.Management.Automation.Language
@@ -1591,5 +1591,5 @@ filter ConvertFrom-ModuleManifest {
15911591
# To fix this we will just use the name out of the module.psd1 when installing
15921592
# FIXME: DBops dependency version issue
15931593

1594-
Export-ModuleMember -Function Get-ModuleFastPlan, Install-ModuleFast
15951594
Set-Alias imf -Value Install-ModuleFast
1595+
Export-ModuleMember -Function Get-ModuleFastPlan, Install-ModuleFast -Alias imf

ModuleFast.tests.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,4 +614,15 @@ Describe 'Install-ModuleFast' -Tag 'E2E' {
614614
$actual | Should -BeLike '*incomplete installation detected*'
615615
Test-Path $incompleteItemPath | Should -BeFalse
616616
}
617+
618+
Describe 'GitHub Packages' {
619+
It 'Gets Specific Module' {
620+
$credential = [PSCredential]::new('Pester', (Get-Secret -Name 'ReadOnlyPackagesGithubPAT'))
621+
$actual = Install-ModuleFast @imfParams -Specification 'PrereleaseTest=0.0.1' -Source 'https://nuget.pkg.github.com/justingrote/index.json' -Credential $credential -WhatIf
622+
$actual.Name | Should -Be 'PrereleaseTest'
623+
$actual.ModuleVersion -as 'NuGet.Versioning.NuGetVersion' | Should -Be '0.0.1'
624+
}
625+
}
626+
617627
}
628+

0 commit comments

Comments
 (0)