Skip to content

Commit 0df1245

Browse files
author
Kapil Borle
committed
Fix failing test case
1 parent 034191f commit 0df1245

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Tests/Engine/RuleSuppression.tests.ps1

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,16 @@ Describe "RuleSuppressionWithoutScope" {
4949
}
5050
}
5151

52-
Context "Bad Rule Suppression" {
53-
It "Throws a non-terminating error" {
54-
Invoke-ScriptAnalyzer -ScriptDefinition $ruleSuppressionBad -IncludeRule "PSAvoidUsingUserNameAndPassWordParams" -ErrorVariable errorRecord 2>$null
55-
$errorRecord.Count | Should Be 1
56-
$errorRecord.FullyQualifiedErrorId | Should match "suppression message attribute error"
52+
if (!$testingLibraryUsage)
53+
{
54+
Context "Bad Rule Suppression" {
55+
It "Throws a non-terminating error" {
56+
Invoke-ScriptAnalyzer -ScriptDefinition $ruleSuppressionBad -IncludeRule "PSAvoidUsingUserNameAndPassWordParams" -ErrorVariable errorRecord -ErrorAction SilentlyContinue
57+
$errorRecord.Count | Should Be 1
58+
$errorRecord.FullyQualifiedErrorId | Should match "suppression message attribute error"
5759
}
5860
}
61+
}
5962
}
6063

6164
Describe "RuleSuppressionWithScope" {

0 commit comments

Comments
 (0)