Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

- Move test result breakdown chart to Preview pane.

## [0.2.0] 2025-05-28

### Added
Expand Down
19 changes: 19 additions & 0 deletions PesterExplorer/Private/Get-PreviewPanel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ function Get-PreviewPanel {
# SelectedItem can be a few different types:
# - A Pester object (Run, Container, Block, Test)

#region Breakdown
# Skip if the object is null or they are all zero.
if (
(
$object.PassedCount +
$object.InconclusiveCount +
$object.SkippedCount +
$object.FailedCount
) -gt 0
) {
$data = @()
$data += New-SpectreChartItem -Label "Passed" -Value ($object.PassedCount) -Color "Green"
$data += New-SpectreChartItem -Label "Failed" -Value ($object.FailedCount) -Color "Red"
$data += New-SpectreChartItem -Label "Inconclusive" -Value ($object.InconclusiveCount) -Color "Grey"
$data += New-SpectreChartItem -Label "Skipped" -Value ($object.SkippedCount) -Color "Yellow"
$result += Format-SpectreBreakdownChart -Data $data
}
#endregion Breakdown

# For Tests Let's print some more details
if ($object.GetType().Name -eq "Test") {
$formatSpectrePanelSplat = @{
Expand Down
8 changes: 0 additions & 8 deletions PesterExplorer/Private/Get-TitlePanel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ function Get-TitlePanel {
$title += " | $($Item.GetType().Name): $($objectName)"
}
$rows += $title
#region Breakdown
$data = @()
$data += New-SpectreChartItem -Label "Passed" -Value ($Item.PassedCount) -Color "Green"
$data += New-SpectreChartItem -Label "Inconclusive" -Value ($Item.InconclusiveCount) -Color "Grey"
$data += New-SpectreChartItem -Label "Skipped" -Value ($Item.SkippedCount) -Color "Yellow"
$data += New-SpectreChartItem -Label "Failed" -Value ($Item.FailedCount) -Color "Red"
$rows += Format-SpectreBreakdownChart -Data $data -ShowPercentage
#endregion Breakdown

return $rows | Format-SpectreRows |
Format-SpectreAligned -HorizontalAlignment Center -VerticalAlignment Middle |
Expand Down
Loading