mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[ubuntu] Refactor pester tests (#9006)
* [ubuntu] Refactor pester tests * Fix key name and add BeforeAll * Fix ActionArchiveCache test
This commit is contained in:
committed by
GitHub
parent
2179765026
commit
dbb10c67ba
@@ -96,8 +96,7 @@ function ShouldReturnZeroExitCode {
|
||||
[bool] $succeeded = $result.ExitCode -eq 0
|
||||
if ($Negate) { $succeeded = -not $succeeded }
|
||||
|
||||
if (-not $succeeded)
|
||||
{
|
||||
if (-not $succeeded) {
|
||||
$commandOutputIndent = " " * 4
|
||||
$commandOutput = ($result.Output | ForEach-Object { "${commandOutputIndent}${_}" }) -join "`n"
|
||||
$failureMessage = "Command '${ActualValue}' has finished with exit code`n${commandOutput}"
|
||||
@@ -149,8 +148,7 @@ function ShouldOutputTextMatchingRegex {
|
||||
if (-not $succeeded) {
|
||||
if ($Negate) {
|
||||
$failureMessage = "Expected regular expression '$RegularExpression' for '$ActualValue' command to not match '$output', but it did match."
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$failureMessage = "Expected regular expression '$RegularExpression' for '$ActualValue' command to match '$output', but it did not match."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user