MCPcopy Create free account
hub / github.com/commander-cli/commander / Test_PrintSummary

Function Test_PrintSummary

pkg/output/cli_test.go:57–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func Test_PrintSummary(t *testing.T) {
58 r := runtime.Result{
59 Duration: 10,
60 Failed: 1,
61 TestResults: createFakeTestResults(),
62 }
63
64 var buf bytes.Buffer
65 writer := NewCliOutput(true)
66 writer.out = &buf
67
68 outResult := writer.PrintSummary(r)
69 assert.False(t, outResult)
70
71 output := buf.String()
72 assert.Contains(t, output, "✗ [192.168.0.1] 'Failed test', on property 'Stdout'")
73 assert.NotContains(t, output, "✓ [docker-host] Successful test")
74}
75
76func createFakeTestResults() []runtime.TestResult {
77 tr := runtime.TestResult{

Callers

nothing calls this directly

Calls 3

createFakeTestResultsFunction · 0.85
NewCliOutputFunction · 0.85
PrintSummaryMethod · 0.80

Tested by

no test coverage detected