From 32fb032ba04cb8f817c2f3be090bd23dde17803d Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 18:03:42 +0100 Subject: [PATCH] test: tighten talk diagnostic event assertion --- src/talk/diagnostics.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/talk/diagnostics.test.ts b/src/talk/diagnostics.test.ts index 9a175e99f1f..16edbfccab8 100644 --- a/src/talk/diagnostics.test.ts +++ b/src/talk/diagnostics.test.ts @@ -57,7 +57,11 @@ describe("talk diagnostics", () => { await new Promise((resolve) => setImmediate(resolve)); expect(diagnostics).toHaveLength(1); - expect(diagnostics[0]).toMatchObject({ + const [diagnostic] = diagnostics; + if (!diagnostic) { + throw new Error("Expected talk diagnostic event"); + } + expect(diagnostic).toMatchObject({ trusted: true, event: { type: "talk.event", @@ -67,6 +71,6 @@ describe("talk diagnostics", () => { byteLength: 320, }, }); - expect(JSON.stringify(diagnostics[0]?.event)).not.toContain("private transcript"); + expect(JSON.stringify(diagnostic.event)).not.toContain("private transcript"); }); });