MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestJSONOutput

Function TestJSONOutput

tests/smoke/output_test.go:10–23  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestJSONOutput(t *testing.T) {
11 stdout := heyOK(t, "box", "list", "--json")
12
13 var resp Response
14 if err := json.Unmarshal([]byte(stdout), &resp); err != nil {
15 t.Fatalf("--json output is not valid JSON: %v", err)
16 }
17 if !resp.OK {
18 t.Error("expected ok=true")
19 }
20 if resp.Data == nil {
21 t.Error("expected non-nil data")
22 }
23}
24
25func TestQuietOutput(t *testing.T) {
26 stdout := heyOK(t, "box", "list", "--quiet")

Callers

nothing calls this directly

Calls 2

heyOKFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected