We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8720e88 commit 6c8d67bCopy full SHA for 6c8d67b
internal/printer/printer_test.go
@@ -6,6 +6,7 @@ import (
6
"io"
7
"net/http"
8
"os"
9
+ "regexp"
10
"strings"
11
"testing"
12
@@ -50,7 +51,9 @@ func TestPrintWithoutSymbolButWithColorOnWindows(t *testing.T) {
50
51
// On Windows we don't use Unicode symbols, but colored text may vary by library/version.
52
// Assert content is present and no unicode cross mark appears.
53
s := stdErr.String()
- assert.Contains(t, s, "[ERROR] Test\n")
54
+ ansi := regexp.MustCompile(`\x1b\[[0-9;]*m`)
55
+ plain := ansi.ReplaceAllString(s, "")
56
+ assert.Contains(t, plain, "[ERROR] Test\n")
57
assert.NotContains(t, s, "\u274C")
58
}
59
0 commit comments