fix(generator): suppress warning console output during tests

Use NullLogger instead of DefaultPtermLogger during tests to prevent
console output. Warnings are still written to warnings.log for
comparison. This prevents GitHub Actions Go problem matcher from
treating any warning-like output as errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lea Anthony 2025-12-07 21:41:14 +11:00
commit f3ad34f475

View file

@ -13,7 +13,6 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
"github.com/pterm/pterm"
"github.com/wailsapp/wails/v3/internal/flags"
"github.com/wailsapp/wails/v3/internal/generator/config"
"github.com/wailsapp/wails/v3/internal/generator/render"
@ -95,15 +94,17 @@ func TestGenerator(t *testing.T) {
generator := NewGenerator(
test.options,
creator,
config.DefaultPtermLogger(nil),
// Use NullLogger to suppress console output during tests.
// Warnings are written to warnings.log for comparison instead.
// This prevents GitHub Actions Go problem matcher from treating
// warning output as errors.
config.NullLogger,
)
_, err := generator.Generate(testcases)
if report := (*ErrorReport)(nil); errors.As(err, &report) {
if report.HasErrors() {
t.Error(report)
} else if report.HasWarnings() {
pterm.Warning.Println(report)
}
// Log warnings and compare with reference output.