We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05344a3 commit f5df606Copy full SHA for f5df606
1 file changed
internal/metrics/metrics_test.go
@@ -56,11 +56,11 @@ func TestZerologMetricsMetadata(t *testing.T) {
56
func TestZerologMetricsInvalidFileDoesNotPanic(t *testing.T) {
57
// Provide a path to a directory that definitely does not exist
58
invalidPath := "/does/not/exist/timestamps.log"
59
-
+
60
// Create the metrics writer with timestamps enabled but an invalid path
61
writer := NewZerologMetrics(true, invalidPath, "container-test")
62
63
- // This call would panic with a nil pointer dereference without the fix.
64
- // With the fix, it will safely execute the mockWriter's no-op Capture().
65
- writer.Capture(TS00)
+ if writer == nil {
+ t.Fatal("expected non-nil writer (fallback to mockWriter), got nil")
+ }
66
}
0 commit comments