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"); }); });