Skip to content

Commit

Permalink
Update tests to include secret removal and adjust context cleanup timing
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Dec 7, 2024
1 parent 5219f17 commit 0fae32b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/Context.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ Describe 'Private functions' {
}
}
#>

BeforeAll {
Get-SecretInfo | Remove-Secret
}
Describe 'Context' {
Context 'Function: Set-Context' {
It "Set-Context -ID 'TestID1'" {
Expand Down Expand Up @@ -178,14 +180,14 @@ Describe 'Context' {
}

Context 'Function: Rename-Context' {
BeforeAll {
BeforeEach {
# Ensure no contexts exist before starting tests
Get-Context | ForEach-Object {
Remove-Context -ID $_.ID
}
}

AfterAll {
AfterEach {
# Cleanup any contexts created during tests
Get-Context | ForEach-Object {
Remove-Context -ID $_.ID
Expand Down

0 comments on commit 0fae32b

Please sign in to comment.