update mock logger and tests

This commit is contained in:
Alex Holliday committed 2026-04-07 11:10:24 -07:00
1 parent c80720c8c9
commit 96beda5c47
2 files changed
+12

No files matched your search

+4
View File
@@ -1,8 +1,12 @@
import { jest } from "@jest/globals";
export const createMockLogger = () => ({
serviceName: "test",
info: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
debug: jest.fn(),
cacheLog: jest.fn(),
getLogs: jest.fn().mockReturnValue([]),
buildLogEntry: jest.fn().mockReturnValue({ level: "info", timestamp: new Date().toISOString() }),
});
+8
View File
@@ -109,6 +109,14 @@ describe("MonitorService", () => {
expect(result).toMatchObject({ count: 2 });
expect(result.monitors).toHaveLength(2);
expect(result.monitors[0]).toHaveProperty("recentChecks");
expect(result.monitors[0].recentChecks.length).toBeGreaterThan(0);
expect(result.monitors[0].recentChecks[0]).toEqual(
expect.objectContaining({
responseTime: expect.any(Number),
status: expect.any(Boolean),
message: expect.any(String),
})
);
});
});