From 3b1520bfc3e2b233bd9928292198de6df99bf5a8 Mon Sep 17 00:00:00 2001 From: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:40:23 -0300 Subject: [PATCH] test(sse): drop the dead collectSSE helper that reds the lint gate #12151 landed with a never-called collectSSE helper in stream-passthrough-usage-estimation.test.ts; its three unused identifiers (collectSSE / stream / writable) fail 'npm run lint:json -- --max-warnings 0', so the 'No new ESLint warnings' job reds every PR merge-ref cut from the current tip (first seen on PR #11564's post-sync run). createSSEStream and parseSSEUsage are actually used and stay; only the dead closure goes. File suite still passes 6/6. --- ...stream-passthrough-usage-estimation.test.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/unit/stream-passthrough-usage-estimation.test.ts b/tests/unit/stream-passthrough-usage-estimation.test.ts index 8d6f1d80de..2131062c5a 100644 --- a/tests/unit/stream-passthrough-usage-estimation.test.ts +++ b/tests/unit/stream-passthrough-usage-estimation.test.ts @@ -34,24 +34,6 @@ test("passthrough no fake: tool_only contentLength==0 -> no estimate (tool_calls import { createSSEStream } from "../../open-sse/utils/stream.ts"; -function collectSSE(stream: TransformStream) { - return async (writable: WritableStream, readable: ReadableStream) => { - const chunks: string[] = []; - const decoder = new TextDecoder(); - const reader = readable.getReader(); - try { - while (true) { - const { done, value } = await reader.read(); - if (done) break; - chunks.push(decoder.decode(value, { stream: true })); - } - } finally { - reader.releaseLock(); - } - return chunks.join(""); - }; -} - function parseSSEUsage(sseText: string): unknown[] { return sseText .split("\n\n")