Skip to content

Commit 6b14de1

Browse files
committed
test(signing): 🧪 Skip tests for Store mode on non-Windows platforms
* Updated tests to skip execution on non-Windows systems. * Ensures that Store mode tests are only run in a compatible environment.
1 parent 49409cd commit 6b14de1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/Signing.tests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Describe 'Code Signing Functions' {
3737
}
3838
}
3939

40-
It 'Resolves to Store mode when SIGNCERTIFICATE environment variable is not set' {
40+
It 'Resolves to Store mode when SIGNCERTIFICATE environment variable is not set' -Skip:(-not $IsWindows) {
4141
Remove-Item env:\SIGNCERTIFICATE -ErrorAction SilentlyContinue
4242
Mock Get-ChildItem {}
4343
$VerboseOutput = Get-PSBuildCertificate -Verbose 4>&1
@@ -46,7 +46,7 @@ Describe 'Code Signing Functions' {
4646
}
4747

4848
# Store mode only works on Windows
49-
Context 'Store mode' -Skip:(-not $IsWindows) {
49+
Context 'Store mode' {
5050
It 'Searches the certificate store for a valid code-signing certificate' -Skip:(-not $IsWindows) {
5151
# On Windows, we can test the actual logic without mocking the cert store itself
5252
# Instead, just verify the function accepts the parameter and attempts the search
@@ -57,7 +57,7 @@ Describe 'Code Signing Functions' {
5757
{ Get-PSBuildCertificate -CertificateSource Store -ErrorAction SilentlyContinue } | Should -Not -Throw
5858
}
5959

60-
It 'Returns $null when no valid certificate is found' {
60+
It 'Returns $null when no valid certificate is found' -Skip:(-not $IsWindows) {
6161
Mock Get-ChildItem { }
6262
$cert = Get-PSBuildCertificate -CertificateSource Store
6363
$cert | Should -BeNullOrEmpty

0 commit comments

Comments
 (0)