MCPcopy Index your code
hub / github.com/keploy/keploy / TestJSONWriterWriteDisabled

Function TestJSONWriterWriteDisabled

utils/output_test.go:54–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestJSONWriterWriteDisabled(t *testing.T) {
55 writer := NewJSONWriter(false)
56
57 out, err := captureStdout(t, func() error {
58 return writer.Write(map[string]string{"status": "ok"})
59 })
60 if err != nil {
61 t.Fatalf("expected no error, got %v", err)
62 }
63 if out != "" {
64 t.Fatalf("expected no output, got %q", out)
65 }
66}
67
68func TestJSONWriterWriteMarshalError(t *testing.T) {
69 writer := NewJSONWriter(true)

Callers

nothing calls this directly

Calls 3

WriteMethod · 0.95
NewJSONWriterFunction · 0.85
captureStdoutFunction · 0.85

Tested by

no test coverage detected