diff --git a/main_test.go b/main_test.go index 5ff2a12b1..f749a9cfa 100644 --- a/main_test.go +++ b/main_test.go @@ -49,6 +49,8 @@ func TestRunmeRunAll(t *testing.T) { func TestSkipPromptsWithinAPty(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() + os.Setenv("RUNME_VERBOSE", "false") + defer os.Unsetenv("RUNME_VERBOSE") cmd := exec.Command("go", "run", ".", "run", "skip-prompts-sample") ptmx, err := pty.StartWithAttrs(cmd, &pty.Winsize{Rows: 25, Cols: 80}, &syscall.SysProcAttr{}) @@ -68,7 +70,8 @@ func TestSkipPromptsWithinAPty(t *testing.T) { assert.Nil(t, err, "Command execution failed") expected := "The content of ENV is " - current := RemoveAnsiCodes(buf.String()) + current := buf.String() + current = RemoveAnsiCodes(current) current = strings.TrimSpace(current) assert.Equal(t, expected, current, "Output does not match")