Skip to content

Commit d8517c6

Browse files
committed
Minor UT fixes
1 parent bbef392 commit d8517c6

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Tests/GitHubGists.tests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,10 @@ try
309309
}
310310

311311
AfterAll {
312-
Remove-Item -Path $tempPath -Recurse -ErrorAction SilentlyContinue -Force
312+
if (Get-Variable -Name tempPath -ErrorAction SilentlyContinue)
313+
{
314+
Remove-Item -Path $tempPath -Recurse -ErrorAction SilentlyContinue -Force
315+
}
313316
}
314317

315318
Context 'Download gist content' {

Tests/GitHubRepositories.tests.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,11 @@ try
12711271
Describe 'GitHubRepositories\Disable-GitHubRepositoryVulnerabilityAlert' {
12721272
BeforeAll {
12731273
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid)
1274+
1275+
# The CI build has been unreliable with this test.
1276+
# Adding a short sleep to ensure successive queries reflect updated state.
1277+
Start-Sleep -Seconds $script:defaultSleepSecondsForReliability
1278+
12741279
Enable-GitHubRepositoryVulnerabilityAlert -Uri $repo.svn_url
12751280
}
12761281

@@ -1306,6 +1311,11 @@ try
13061311
Describe 'GitHubRepositories\Disable-GitHubRepositorySecurityFix' {
13071312
BeforeAll {
13081313
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid)
1314+
1315+
# The CI build has been unreliable with this test.
1316+
# Adding a short sleep to ensure successive queries reflect updated state.
1317+
Start-Sleep -Seconds $script:defaultSleepSecondsForReliability
1318+
13091319
Enable-GitHubRepositorySecurityFix -Uri $repo.svn_url
13101320
}
13111321

0 commit comments

Comments
 (0)