Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fflaten committed Apr 15, 2023
1 parent 14ba0b7 commit 137d9b7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,7 @@ function Invoke-Pester {
# this will inherit to child scopes and allow Describe / Context to run directly from a file or command line
$invokedViaInvokePester = $true

if ($null -eq $state) {
# Cleanup any leftover mocks from previous runs, but only if we are not running in a nested Pester-run
# todo: move mock cleanup to BeforeAllBlockContainer when there is any?
Remove-MockFunctionsAndAliases -SessionState $PSCmdlet.SessionState
}
else {
if ($null -ne $state) {
# this will inherit to child scopes and affect behavior of ex. TestDrive/TestRegistry
$runningPesterInPester = $true

Check warning

Code scanning / PSScriptAnalyzer

The variable 'runningPesterInPester' is assigned but never used. Warning

The variable 'runningPesterInPester' is assigned but never used.
}
Expand Down

0 comments on commit 137d9b7

Please sign in to comment.