(t *testing.T)
| 59 | } |
| 60 | |
| 61 | func TestTestLoggerSupportsLevels(t *testing.T) { |
| 62 | ts := newTestLogSpy(t) |
| 63 | defer ts.AssertPassed() |
| 64 | |
| 65 | log := NewLogger(ts, Level(zap.WarnLevel)) |
| 66 | |
| 67 | log.Info("received work order") |
| 68 | log.Debug("starting work") |
| 69 | log.Warn("work may fail") |
| 70 | log.Error("work failed", zap.Error(errors.New("great sadness"))) |
| 71 | |
| 72 | assert.Panics(t, func() { |
| 73 | log.Panic("failed to do work") |
| 74 | }, "log.Panic should panic") |
| 75 | |
| 76 | ts.AssertMessages( |
| 77 | "WARN work may fail", |
| 78 | `ERROR work failed {"error": "great sadness"}`, |
| 79 | "PANIC failed to do work", |
| 80 | ) |
| 81 | } |
| 82 | |
| 83 | func TestTestLoggerSupportsWrappedZapOptions(t *testing.T) { |
| 84 | ts := newTestLogSpy(t) |
nothing calls this directly
no test coverage detected