(t *testing.T)
| 124 | } |
| 125 | |
| 126 | func TestRunMaxFailuresAddsOmittedLine(t *testing.T) { |
| 127 | t.Parallel() |
| 128 | |
| 129 | jsonFile := writeEvents(t, |
| 130 | testEvent{Action: "fail", Package: "example.com/pkg", Test: "TestA", Elapsed: 0.10}, |
| 131 | testEvent{Action: "fail", Package: "example.com/pkg", Test: "TestB", Elapsed: 0.20}, |
| 132 | ) |
| 133 | |
| 134 | markdown := runMarkdown(t, jsonFile, config{ |
| 135 | MaxOutputBytes: 8192, |
| 136 | MaxFailures: 1, |
| 137 | FailuresOut: filepath.Join(t.TempDir(), "failures.ndjson"), |
| 138 | }) |
| 139 | require.Contains(t, markdown, "TestA") |
| 140 | require.NotContains(t, markdown, "<code>TestB</code>") |
| 141 | require.Contains(t, markdown, "_... and 1 more failed tests omitted. Download the failures-only artifact for the full list._") |
| 142 | } |
| 143 | |
| 144 | func TestWriteFailuresNDJSONAppliesCap(t *testing.T) { |
| 145 | t.Parallel() |
nothing calls this directly
no test coverage detected