You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using version v2020.6.0 of the PowerShell Extension for VS Code, I am getting a UseDeclaredVarsMoreThanAssignments in my Pester v5 test. The test case is this:
Describe "My Tests" {
BeforeAll {
$myVariable=100
}
Context "My Context" {
It "My Test" {
$myVariable| Should -Not-Be $null
}
}
}
As seen in the screenshot below, I get a false positive warning on the assignment of $myVariable:
When I run this Pester test, it passes just fine. The variable $myVariable is actually used at line 8. However, I think due to the Pester framework, the analyzer isn't able to see that the variable is within scope. I'm honestly not sure what version of PSScriptAnalyzer is bundled in this VS Code extension.
The expected behavior is that this variable does not appear as an analysis warning in the context of Pester.
The text was updated successfully, but these errors were encountered:
Using version
v2020.6.0
of the PowerShell Extension for VS Code, I am getting aUseDeclaredVarsMoreThanAssignments
in my Pester v5 test. The test case is this:As seen in the screenshot below, I get a false positive warning on the assignment of
$myVariable
:When I run this Pester test, it passes just fine. The variable
$myVariable
is actually used at line 8. However, I think due to the Pester framework, the analyzer isn't able to see that the variable is within scope. I'm honestly not sure what version of PSScriptAnalyzer is bundled in this VS Code extension.The expected behavior is that this variable does not appear as an analysis warning in the context of Pester.
The text was updated successfully, but these errors were encountered: