MCPcopy Create free account
hub / github.com/coder/coder / TestRunStripsANSIOutput

Function TestRunStripsANSIOutput

scripts/gotestsummary/main_test.go:100–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestRunStripsANSIOutput(t *testing.T) {
101 t.Parallel()
102
103 jsonFile := writeEvents(t,
104 testEvent{Action: "output", Package: "example.com/pkg", Test: "TestFail", Output: "\x1b[31mred\x1b[0m\n"},
105 testEvent{Action: "fail", Package: "example.com/pkg", Test: "TestFail", Elapsed: 0.10},
106 )
107
108 markdown := runMarkdown(t, jsonFile, config{MaxOutputBytes: 8192})
109 require.Contains(t, markdown, "red")
110 require.NotContains(t, markdown, "\x1b")
111}
112
113func TestRunEscapesTripleBackticksInOutput(t *testing.T) {
114 t.Parallel()

Callers

nothing calls this directly

Calls 3

writeEventsFunction · 0.85
runMarkdownFunction · 0.85
ContainsMethod · 0.45

Tested by

no test coverage detected