From 0aaa3b6ac2e9773176bf0c76ffc68de5645e2ece Mon Sep 17 00:00:00 2001 From: ruinivist Date: Sat, 21 Mar 2026 05:04:05 +0000 Subject: [PATCH] feat: quiten miro test ouput --- cmd/root_test.go | 2 -- internal/miro/test.go | 4 ++-- internal/miro/test_test.go | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/root_test.go b/cmd/root_test.go index a394d12..a5c58cb 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -226,8 +226,6 @@ func TestRunTest(t *testing.T) { "RUN nested/b", "PASS nested/b", "Summary: total=2 passed=2 failed=0", - "echo one\n", - "echo two\n", } { if !strings.Contains(stdout, want) { t.Fatalf("stdout = %q, want substring %q", stdout, want) diff --git a/internal/miro/test.go b/internal/miro/test.go index e7b23cc..cb5c36f 100644 --- a/internal/miro/test.go +++ b/internal/miro/test.go @@ -222,8 +222,8 @@ func replayScenario(scenario testScenario, shellPath string, tio testIO, sandbox compareMarkerEnvName: compareMarkerEnabledValue, }) cmd.Stdin = bytes.NewReader(input) - cmd.Stdout = tio.out - cmd.Stderr = tio.err + cmd.Stdout = io.Discard + cmd.Stderr = io.Discard if err := cmd.Run(); err != nil { return fmt.Errorf("replay failed: %v", err) diff --git a/internal/miro/test_test.go b/internal/miro/test_test.go index 9e8c2c0..be4eb56 100644 --- a/internal/miro/test_test.go +++ b/internal/miro/test_test.go @@ -66,7 +66,7 @@ func TestDiscoverTestScenariosRejectsMissingInFixture(t *testing.T) { } } -func TestReplayScenarioUsesRecordedInputAndStripsScriptWrapper(t *testing.T) { +func TestReplayScenarioUsesRecordedInputAndKeepsReplayOutputQuiet(t *testing.T) { addFakeRecordDependencies(t, "script") t.Setenv("FAKE_SCRIPT_ECHO_STDIN", "1") @@ -97,8 +97,8 @@ func TestReplayScenarioUsesRecordedInputAndStripsScriptWrapper(t *testing.T) { if got := readFile(t, capturedInput); got != "echo replay\nexit\n" { t.Fatalf("captured stdin = %q, want recorded input", got) } - if got := stdout.String(); !strings.Contains(got, "echo replay\nexit\n") { - t.Fatalf("stdout = %q, want streamed replay output", got) + if stdout.String() != "" { + t.Fatalf("stdout = %q, want empty", stdout.String()) } if stderr.String() != "" { t.Fatalf("stderr = %q, want empty", stderr.String())