Skip to content

Commit 0d25731

Browse files
author
PR Batch Tester
committed
test(client): count partial frames before config reassembly
1 parent 0577c86 commit 0d25731

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/client-runtime/src/rpc/session.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,18 @@ describe("RpcSessionFactory", () => {
294294
const parts = new URL(socket.url).searchParams.has("frameParts")
295295
? splitSocketFrame(frame)
296296
: [frame];
297+
expect(parts.length).toBeGreaterThan(1);
298+
expect(yield* session.inboundFrames).toBe(0);
297299

298-
for (const part of parts) {
300+
for (const [index, part] of parts.entries()) {
299301
yield* TestClock.adjust((new TextEncoder().encode(part).length / 4000) * 1000);
300302
socket.serverMessage(part);
303+
expect(yield* session.inboundFrames).toBe(index + 1);
301304
}
302305
yield* Fiber.join(readyFiber);
303306

304307
expect(yield* session.initialConfig).toEqual(config);
308+
expect(yield* session.inboundFrames).toBe(parts.length);
305309
}),
306310
);
307311

0 commit comments

Comments
 (0)