Skip to content

Commit 3804e33

Browse files
authored
Add visual regression tests with golden files for console rendering (#8794)
1 parent 8445f3e commit 3804e33

49 files changed

Lines changed: 1065 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ test:
5555
test-unit:
5656
go test -v -timeout=3m -tags '!integration' -run='^Test' ./...
5757

58+
# Update golden test files
59+
.PHONY: update-golden
60+
update-golden:
61+
@echo "Updating golden test files..."
62+
go test -v ./pkg/console -run='^TestGolden_' -update
63+
5864
# Test specific integration test groups (matching CI workflow)
5965
.PHONY: test-integration-compile
6066
test-integration-compile:

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require (
77
github.com/charmbracelet/bubbletea v1.3.10
88
github.com/charmbracelet/huh v0.8.0
99
github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc
10+
github.com/charmbracelet/x/exp/golden v0.0.0-20251215102626-e0db08df7383
1011
github.com/cli/go-gh/v2 v2.13.0
1112
github.com/creack/pty v1.1.24
1213
github.com/fsnotify/fsnotify v1.9.0
@@ -60,6 +61,7 @@ require (
6061
github.com/ashanbrown/makezero/v2 v2.1.0 // indirect
6162
github.com/atotto/clipboard v0.1.4 // indirect
6263
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
64+
github.com/aymanbagabas/go-udiff v0.3.1 // indirect
6365
github.com/beorn7/perks v1.0.1 // indirect
6466
github.com/bkielbasa/cyclop v1.2.3 // indirect
6567
github.com/blizzy78/varnamelen v0.8.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSTh
165165
github.com/charmbracelet/x/conpty v0.1.0/go.mod h1:rMFsDJoDwVmiYM10aD4bH2XiRgwI7NYJtQgl5yskjEQ=
166166
github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86 h1:JSt3B+U9iqk37QUU2Rvb6DSBYRLtWqFqfxf8l5hOZUA=
167167
github.com/charmbracelet/x/errors v0.0.0-20240508181413-e8d8b6e2de86/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0=
168-
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payRxjMjKgx2PaCWLZ4p3ro9y97+TVLZNaRZgJwSVDQ=
169-
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
168+
github.com/charmbracelet/x/exp/golden v0.0.0-20251215102626-e0db08df7383 h1:R0iAuPE4yU0omOM9ANVmxYqW+ktB9xMDMyxx6prkrA0=
169+
github.com/charmbracelet/x/exp/golden v0.0.0-20251215102626-e0db08df7383/go.mod h1:V8n/g3qVKNxr2FR37Y+otCsMySvZr601T0C7coEP0bw=
170170
github.com/charmbracelet/x/exp/strings v0.0.0-20251106172358-54469c29c2bc h1:9IKnWSTN2Sz73Hu4gmCCBtWSavl2adq34IFpwDIzZPU=
171171
github.com/charmbracelet/x/exp/strings v0.0.0-20251106172358-54469c29c2bc/go.mod h1:/ehtMPNh9K4odGFkqYJKpIYyePhdp1hLBRvyY4bWkH8=
172172
github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk=

0 commit comments

Comments
 (0)