






















@@ -115,10 +115,6 @@ describe("file log redaction", () => {
115115const record = JSON.parse(line ?? "{}") as Record<string, unknown>;
116116expect(record.traceId).toBe(TRACE_ID);
117117expect(record.spanId).toBe(SPAN_ID);
118-expect(record).toMatchObject({
119-traceId: TRACE_ID,
120-spanId: SPAN_ID,
121-});
122118});
123119124120it("writes active request trace context as top-level JSONL fields", () => {
@@ -135,10 +131,8 @@ describe("file log redaction", () => {
135131136132const [line] = fs.readFileSync(logPath, "utf8").trim().split("\n");
137133const record = JSON.parse(line ?? "{}") as Record<string, unknown>;
138-expect(record).toMatchObject({
139-traceId: TRACE_ID,
140-spanId: SPAN_ID,
141-});
134+expect(record.traceId).toBe(TRACE_ID);
135+expect(record.spanId).toBe(SPAN_ID);
142136});
143137144138it("writes hostname and flattened message as top-level JSONL fields", () => {
@@ -166,11 +160,9 @@ describe("file log redaction", () => {
166160167161const [line] = fs.readFileSync(logPath, "utf8").trim().split("\n");
168162const record = JSON.parse(line ?? "{}") as Record<string, unknown>;
169-expect(record).toMatchObject({
170-agent_id: "agent-main",
171-session_id: "agent:main:discord:channel:c1",
172-channel: "discord",
173-message: "session routed",
174-});
163+expect(record.agent_id).toBe("agent-main");
164+expect(record.session_id).toBe("agent:main:discord:channel:c1");
165+expect(record.channel).toBe("discord");
166+expect(record.message).toBe("session routed");
175167});
176168});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。