Skip to content

Commit 2690525

Browse files
committed
fix: Initialize logger in app_test.go
1 parent 607a342 commit 2690525

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

app/app_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ package app
22

33
import (
44
"claude-squad/config"
5+
"claude-squad/log"
56
"claude-squad/session"
67
"claude-squad/ui"
78
"claude-squad/ui/overlay"
89
"context"
910
"fmt"
11+
"os"
1012
"testing"
1113

1214
"github.com/charmbracelet/bubbles/spinner"
@@ -15,6 +17,19 @@ import (
1517
"github.com/stretchr/testify/require"
1618
)
1719

20+
// TestMain runs before all tests to set up the test environment
21+
func TestMain(m *testing.M) {
22+
// Initialize the logger before any tests run
23+
log.Initialize(false)
24+
defer log.Close()
25+
26+
// Run all tests
27+
exitCode := m.Run()
28+
29+
// Exit with the same code as the tests
30+
os.Exit(exitCode)
31+
}
32+
1833
// TestConfirmationModalStateTransitions tests state transitions without full instance setup
1934
func TestConfirmationModalStateTransitions(t *testing.T) {
2035
// Create a minimal home struct for testing state transitions

0 commit comments

Comments
 (0)