fix: preserve structured logger metadata

This commit is contained in:
MythEclipse
2026-05-19 02:43:52 +07:00
parent 1aa8c6a370
commit f8ba4b41e9
3 changed files with 45 additions and 17 deletions
+9
View File
@@ -54,4 +54,13 @@ describe("logger serialization", () => {
formatLogMetadataForTest({ context: "bot", signal: "SIGINT", count: 2 }),
).toEqual({ context: "bot", signal: "SIGINT", count: 2 });
});
it("serializes dates and regexps without dropping values", () => {
const createdAt = new Date("2026-05-19T00:00:00.000Z");
expect(formatLogMetadataForTest({ createdAt, pattern: /voice/i })).toEqual({
createdAt: "2026-05-19T00:00:00.000Z",
pattern: "/voice/i",
});
});
});