Skip to content

Commit

Permalink
fix test in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pastuxso committed Oct 26, 2023
1 parent 09b7c20 commit 9734601
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand All @@ -68,7 +70,8 @@ func TestSkipPromptsWithinAPty(t *testing.T) {
assert.Nil(t, err, "Command execution failed")

expected := "The content of ENV is <insert-env-here>"
current := RemoveAnsiCodes(buf.String())
current := buf.String()
current = RemoveAnsiCodes(current)
current = strings.TrimSpace(current)

assert.Equal(t, expected, current, "Output does not match")
Expand Down

0 comments on commit 9734601

Please sign in to comment.