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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.3.1] 2025-05-30

### Added

- Add VIM (i.e. `hjkl`) navigation support.

Check warning on line 12 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / ci / Run Linters

Unknown word (hjkl) Suggestions: (hulk, hail, hake, haku, hall)

### Fixed

- Add parameter validation and mandatory to ensure commands don't fail
unexpectedly.

## [0.3.0] 2025-05-29

### Added
Expand Down
2 changes: 1 addition & 1 deletion PesterExplorer/PesterExplorer.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PesterExplorer.psm1'

# Version number of this module.
ModuleVersion = '0.3.0'
ModuleVersion = '0.3.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
6 changes: 3 additions & 3 deletions PesterExplorer/Private/Get-ShortcutKeyPanel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ function Get-ShortcutKeyPanel {
#>
[CmdletBinding()]
$shortcutKeys = @(
"Up, Down - Navigate",
"Up/J, Down/K - Navigate",
"Home, End - Jump to Top/Bottom",
"PageUp, PageDown - Scroll",
"Enter - Explore",
"Tab - Switch Panel",
"Enter - Explore Item",
"Tab, Left/H, Right/L - Switch Panel",
"Esc - Back",
"Ctrl+C - Exit"
)
Expand Down
29 changes: 21 additions & 8 deletions PesterExplorer/Public/Show-PesterResult.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function Show-PesterResult {
Justification='This is actually used in the script block.'
)]
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Pester.Run]
$PesterResult,
Expand Down Expand Up @@ -89,14 +90,13 @@ function Show-PesterResult {

# Handle input
$lastKeyPressed = Get-LastKeyPressed
# ToDo: Add vim navigation keys
if ($null -ne $lastKeyPressed) {
#region List Navigation
if($selectedPane -eq 'list') {
if ($lastKeyPressed.Key -eq "DownArrow") {
if ($lastKeyPressed.Key -in @("j", "DownArrow")) {
$selectedItem = $list[($list.IndexOf($selectedItem) + 1) % $list.Count]
$scrollPosition = 0
} elseif ($lastKeyPressed.Key -eq "UpArrow") {
} elseif ($lastKeyPressed.Key -in @("k", "UpArrow")) {
$selectedItem = $list[($list.IndexOf($selectedItem) - 1 + $list.Count) % $list.Count]
$scrollPosition = 0
} elseif ($lastKeyPressed.Key -eq "PageDown") {
Expand All @@ -115,7 +115,7 @@ function Show-PesterResult {
} elseif ($lastKeyPressed.Key -eq "End") {
$selectedItem = $list[-1]
$scrollPosition = 0
} elseif ($lastKeyPressed.Key -in @("Tab", "RightArrow")) {
} elseif ($lastKeyPressed.Key -in @("Tab", "RightArrow", "l")) {
$selectedPane = 'preview'
} elseif ($lastKeyPressed.Key -eq "Enter") {
<# Recurse into Pester Object #>
Expand Down Expand Up @@ -150,8 +150,7 @@ function Show-PesterResult {
}
else {
#region Preview Navigation
# ToDo: Add support for scrolling the right panel
if ($lastKeyPressed.Key -in "Escape", "Tab", "LeftArrow", "RightArrow") {
if ($lastKeyPressed.Key -in "Escape", "Tab", "LeftArrow", "h") {
$selectedPane = 'list'
} elseif ($lastKeyPressed.Key -eq "Down") {
# Scroll down in the preview panel
Expand All @@ -172,8 +171,22 @@ function Show-PesterResult {

# Generate new data
$titlePanel = Get-TitlePanel -Item $object
$listPanel = Get-ListPanel -List $list -SelectedItem $selectedItem -SelectedPane $selectedPane
$previewPanel = Get-PreviewPanel -Items $items -SelectedItem $selectedItem -ScrollPosition $scrollPosition -PreviewHeight $previewHeight -PreviewWidth $previewWidth -SelectedPane $selectedPane
$getListPanelSplat = @{
List = $list
SelectedItem = $selectedItem
SelectedPane = $selectedPane
}
$listPanel = Get-ListPanel @getListPanelSplat

$getPreviewPanelSplat = @{
Items = $items
SelectedItem = $selectedItem
ScrollPosition = $scrollPosition
PreviewHeight = $previewHeight
PreviewWidth = $previewWidth
SelectedPane = $selectedPane
}
$previewPanel = Get-PreviewPanel @getPreviewPanelSplat

# Update layout
$layout["header"].Update($titlePanel) | Out-Null
Expand Down
2 changes: 2 additions & 0 deletions PesterExplorer/Public/Show-PesterResultTree.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ function Show-PesterResultTree {
[CmdletBinding()]
[OutputType([void])]
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Pester.Run]
$PesterResult
)
Expand Down
4 changes: 2 additions & 2 deletions docs/en-US/Show-PesterResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## SYNTAX

```
Show-PesterResult [[-PesterResult] <Run>] [-NoShortcutPanel] [-ProgressAction <ActionPreference>]
Show-PesterResult [-PesterResult] <Run> [-NoShortcutPanel] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
```

Expand Down Expand Up @@ -42,7 +42,7 @@
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Expand Down Expand Up @@ -70,7 +70,7 @@
```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Check warning on line 73 in docs/en-US/Show-PesterResult.md

View workflow job for this annotation

GitHub Actions / ci / Run Linters

Unknown word (proga) Suggestions: (proa, prog, progs, Prog, prgo)

Required: False
Position: Named
Expand Down
4 changes: 2 additions & 2 deletions docs/en-US/Show-PesterResultTree.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## SYNTAX

```
Show-PesterResultTree [[-PesterResult] <Run>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Show-PesterResultTree [-PesterResult] <Run> [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -43,7 +43,7 @@
Parameter Sets: (All)
Aliases:

Required: False
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Expand All @@ -56,7 +56,7 @@
```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Check warning on line 59 in docs/en-US/Show-PesterResultTree.md

View workflow job for this annotation

GitHub Actions / ci / Run Linters

Unknown word (proga) Suggestions: (proa, prog, progs, Prog, prgo)

Required: False
Position: Named
Expand Down
Loading