File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -134,11 +134,10 @@ Describe 'Quality for module' -Tags 'TestQuality' {
134134 It ' Should pass Script Analyzer for <Name>' - ForEach ($testCases | Where-Object { $_.Name -in $mut.ExportedCommands.Values.Name }) - Skip:(-not $scriptAnalyzerRules ) {
135135 $functionFile = Get-ChildItem - Path $sourcePath - Recurse - Include " $Name .ps1"
136136
137- $pssaResult = (Invoke-ScriptAnalyzer - Path $functionFile.FullName )
138- $report = $pssaResult | Format-Table - AutoSize | Out-String - Width 110
139- $pssaResult | Should - BeNullOrEmpty - Because `
140- " some rule triggered.`r`n`r`n $report "
141- }
137+ $Result = (Invoke-ScriptAnalyzer - Path $functionFile.FullName )
138+ $report = $Result | Format-Table - AutoSize | Out-String - Width 110
139+ $Errors = if ($Result ) { $Result | Where-Object { $_.Severity -ne ' Warning' } } else { @ () }
140+ $Errors | Should - BeNullOrEmpty - Because " some rule triggered.`r`n`r`n $report " }
142141}
143142
144143Describe ' Help for module' - Tags ' helpQuality' {
You can’t perform that action at this time.
0 commit comments