Skip to content

Commit

Permalink
(chocolatey#3565) Add comments around Pester tests
Browse files Browse the repository at this point in the history
Add some comments to the Pester Tests to better describe the purpose of
the test and why some commands are expected to exit 0 and others not.
  • Loading branch information
corbob committed Nov 26, 2024
1 parent 56f2705 commit 9f92a3e
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions tests/pester-tests/features/CredentialProvider.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
Describe 'Ensuring credentials do not bleed from configured sources' -Tag CredentialProvider -ForEach @(
# These tests are to ensure that credentials from one configured and enabled source are not
# picked up and used when a URL is matching based on the hostname. These tests use an authenticated
# source without explicitly providing a username/password. It is expected that Chocolatey with prompt for
# the username and password.
Describe 'Ensuring credentials do not bleed from configured sources' -Tag CredentialProvider -ForEach @(
# Info and outdated are returning 0 in all test cases we've thrown at them.
# Suspect the only way either of these commands actually return non-zero is in a scenario where
# something goes catastrophically wrong outside of the actual command calls.
@{
Command = 'info'
ExitCode = 0
}
@{
Command = 'install'
ExitCode = 1
}
}
@{
Command = 'outdated'
ExitCode = 0
}
}
@{
Command = 'install'
ExitCode = 1
}
@{
Command = 'search'
ExitCode = 1
}
}
@{
Command = 'upgrade'
ExitCode = 1
}
}
@{
Command = 'download'
ExitCode = 1
}
}
) {
BeforeDiscovery {
$HasLicensedExtension = Test-PackageIsEqualOrHigher -PackageName 'chocolatey.extension' -Version '6.0.0'
Expand Down

0 comments on commit 9f92a3e

Please sign in to comment.