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