MCPcopy
hub / github.com/keploy/keploy / TestJSONWriterWriteMarshalError

Function TestJSONWriterWriteMarshalError

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

Source from the content-addressed store, hash-verified

66}
67
68func TestJSONWriterWriteMarshalError(t *testing.T) {
69 writer := NewJSONWriter(true)
70 ch := make(chan int)
71
72 out, err := captureStdout(t, func() error {
73 return writer.Write(ch)
74 })
75 if err == nil {
76 t.Fatal("expected marshal error, got nil")
77 }
78 if out != "" {
79 t.Fatalf("expected no output on marshal error, got %q", out)
80 }
81}
82
83func TestJSONWriterIsEnabled(t *testing.T) {
84 if !NewJSONWriter(true).IsEnabled() {

Callers

nothing calls this directly

Calls 3

WriteMethod · 0.95
NewJSONWriterFunction · 0.85
captureStdoutFunction · 0.85

Tested by

no test coverage detected