From 0f3ee8d10746b59a608f5fb2137fb5d2784b673b Mon Sep 17 00:00:00 2001 From: roboomp Date: Sun, 28 Jun 2026 17:10:51 +0000 Subject: [PATCH] style: bun run fix --- .../test/collab/replication-shrink.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/coding-agent/test/collab/replication-shrink.test.ts b/packages/coding-agent/test/collab/replication-shrink.test.ts index 155e042f9..101ecc1ba 100644 --- a/packages/coding-agent/test/collab/replication-shrink.test.ts +++ b/packages/coding-agent/test/collab/replication-shrink.test.ts @@ -224,8 +224,7 @@ describe("collab replication shrinking (#3739)", () => { frames.push(frame); if (frame.t === "snapshot-chunk" && frame.final) trainDone.resolve(); }; - guest.onOpen = () => - guest.send({ t: "hello", proto: COLLAB_PROTO, name: "test", writeToken }); + guest.onOpen = () => guest.send({ t: "hello", proto: COLLAB_PROTO, name: "test", writeToken }); const guestClosed = Promise.withResolvers(); guest.onClose = (reason, willReconnect) => { closes.push({ reason, willReconnect }); @@ -261,10 +260,11 @@ describe("collab replication shrinking (#3739)", () => { expect(chunkEntries.map(e => e.id)).toEqual(snapshot.entries.map(e => e.id)); const bigShrunk = chunkEntries.find(e => e.id === snapshot.bigEntryId); - if (!bigShrunk || bigShrunk.type !== "message") throw new Error("expected shrunk big message entry"); - const shrunkContent = bigShrunk.message.content; - expect(typeof shrunkContent).toBe("string"); - if (typeof shrunkContent !== "string") throw new Error("expected string content"); + if (bigShrunk?.type !== "message") throw new Error("expected shrunk big message entry"); + const bigMessage = bigShrunk.message; + if (bigMessage.role !== "user") throw new Error("expected shrunk big user message"); + const shrunkContent = bigMessage.content; + if (typeof shrunkContent !== "string") throw new Error("expected string content after shrink"); // Original was 5 MB; the head-truncation marker carries the exact // number of dropped chars so the guest can show "this was bigger". expect(shrunkContent.length).toBeLessThan(snapshot.bigPayloadLength / 10);