Skip to content

Commit 85c8b9d

Browse files
author
Quoc Truong
committed
Fix test failures
1 parent 08765c2 commit 85c8b9d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Tests/Engine/GetScriptAnalyzerRule.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Describe "TestSeverity" {
118118

119119
It "filters rules based on multiple severity inputs"{
120120
$rules = Get-ScriptAnalyzerRule -Severity Error,Information
121-
$rules.Count | Should be 13
121+
$rules.Count | Should be 14
122122
}
123123

124124
It "takes lower case inputs" {

Tests/Engine/InvokeScriptAnalyzer.tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ Describe "Test IncludeRule" {
143143
Context "IncludeRule supports wild card" {
144144
It "includes 1 wildcard rule"{
145145
$includeWildcard = Invoke-ScriptAnalyzer $directory\..\Rules\BadCmdlet.ps1 -IncludeRule $avoidRules
146-
$includeWildcard.Count | Should be 3
146+
$includeWildcard.Count | Should be 0
147147
}
148148

149149
it "includes 2 wildcardrules" {
150150
$includeWildcard = Invoke-ScriptAnalyzer $directory\..\Rules\BadCmdlet.ps1 -IncludeRule $avoidRules, $useRules
151-
$includeWildcard.Count | Should be 7
151+
$includeWildcard.Count | Should be 4
152152
}
153153
}
154154
}
@@ -174,12 +174,12 @@ Describe "Test Severity" {
174174

175175
It "works with 2 arguments" {
176176
$errors = Invoke-ScriptAnalyzer $directory\TestScript.ps1 -Severity Information, Warning
177-
$errors.Count | Should Be 2
177+
$errors.Count | Should Be 1
178178
}
179179

180180
It "works with lowercase argument"{
181181
$errors = Invoke-ScriptAnalyzer $directory\TestScript.ps1 -Severity information, warning
182-
$errors.Count | Should Be 2
182+
$errors.Count | Should Be 1
183183
}
184184
}
185185

Tests/Engine/RuleSuppression.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Describe "RuleSuppressionWithScope" {
5050
Context "FunctionScope" {
5151
It "Does not raise violations" {
5252
$suppression = $violations | Where-Object {$_.RuleName -eq "PSAvoidUsingPositionalParameters" }
53-
$suppression.Count | Should Be 1
53+
$suppression.Count | Should Be 0
5454
}
5555
}
5656

0 commit comments

Comments
 (0)