File tree Expand file tree Collapse file tree
.github/actions/Get-PesterCodeCoverage/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,24 +158,26 @@ $success = $coveragePercent -ge $coveragePercentTarget
158158$statusIcon = $success ? ' ✅' : ' ❌'
159159$stats | Format-Table - AutoSize | Out-String
160160
161- $missedPaths = $codeCoverage.CommandsMissed |
161+ $missedPathGroups = $codeCoverage.CommandsMissed |
162162 Where-Object { -not [string ]::IsNullOrWhiteSpace($_.File ) } |
163163 Group-Object - Property File |
164164 Sort-Object - Property @ (
165165 @ { Expression = ' Count' ; Descending = $true },
166166 @ { Expression = ' Name' ; Descending = $false }
167- ) |
168- ForEach-Object {
169- $lines = $_.Group |
170- Where-Object { $_.Line -is [ValueType ] } |
171- ForEach-Object { [int ]$_.Line } |
172- Sort-Object - Unique
173- [pscustomobject ]@ {
174- Path = $_.Name
175- MissedCommands = [int ]$_.Count
176- MissedLines = if ($lines.Count -eq 0 ) { ' ' } else { $lines -join ' , ' }
177- }
167+ )
168+
169+ $missedPaths = foreach ($group in $missedPathGroups ) {
170+ $lines = $group.Group |
171+ Where-Object { $_.Line -is [ValueType ] } |
172+ ForEach-Object { [int ]$_.Line } |
173+ Sort-Object - Unique
174+ $missedLines = if ($lines.Count -eq 0 ) { ' ' } else { $lines -join ' , ' }
175+ [pscustomobject ]@ {
176+ Path = $group.Name
177+ MissedCommands = [int ]$group.Count
178+ MissedLines = $missedLines
178179 }
180+ }
179181
180182$missedPathReportPath = ' CodeCoverage-MissedPaths'
181183$null = New-Item - Path $missedPathReportPath - ItemType Directory - Force
You can’t perform that action at this time.
0 commit comments