test: debrand generic formatting fixtures

This commit is contained in:
Peter Steinberger
2026-03-27 21:44:18 +00:00
parent 8ae90e16fc
commit adb20a9fa9
3 changed files with 39 additions and 30 deletions

View File

@@ -5,10 +5,10 @@ describe("parseLogLine", () => {
it("parses structured JSON log lines", () => {
const line = JSON.stringify({
time: "2026-01-09T01:38:41.523Z",
0: '{"subsystem":"gateway/channels/whatsapp"}',
0: '{"subsystem":"gateway/channels/demo-channel"}',
1: "connected",
_meta: {
name: '{"subsystem":"gateway/channels/whatsapp"}',
name: '{"subsystem":"gateway/channels/demo-channel"}',
logLevelName: "INFO",
},
});
@@ -18,8 +18,8 @@ describe("parseLogLine", () => {
expect(parsed).not.toBeNull();
expect(parsed?.time).toBe("2026-01-09T01:38:41.523Z");
expect(parsed?.level).toBe("info");
expect(parsed?.subsystem).toBe("gateway/channels/whatsapp");
expect(parsed?.message).toBe('{"subsystem":"gateway/channels/whatsapp"} connected');
expect(parsed?.subsystem).toBe("gateway/channels/demo-channel");
expect(parsed?.message).toBe('{"subsystem":"gateway/channels/demo-channel"} connected');
expect(parsed?.raw).toBe(line);
});