mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
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:
parent
db4385faed
commit
f3ad34f475
1 changed files with 5 additions and 4 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue