From 8883e3f30790000efb6d31b2632677086ad8ac8a Mon Sep 17 00:00:00 2001 From: Devin Ivy Date: Fri, 24 Apr 2026 16:14:44 -0400 Subject: [PATCH] test(serve): fix Buffer type and add test timeout for spike Co-Authored-By: Claude Sonnet 4.6 --- test/serve/spike.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/serve/spike.test.ts b/test/serve/spike.test.ts index 26d14b5..a865832 100644 --- a/test/serve/spike.test.ts +++ b/test/serve/spike.test.ts @@ -5,7 +5,7 @@ import { createServer, connect } from 'node:net'; import { Worker } from 'node:worker_threads'; describe('fd-passing spike', () => { - it('fd extracted on main and reconstructed as net.Socket on a worker thread', async () => { + it('fd extracted on main and reconstructed as net.Socket on a worker thread', { timeout: 5000 }, async () => { // Spawn worker with an inline string source const workerCode = ` const { parentPort } = require('node:worker_threads'); @@ -44,7 +44,7 @@ describe('fd-passing spike', () => { // Client connects, reads the reply const client = connect(port); const chunks: Buffer[] = []; - client.on('data', (c) => chunks.push(c)); + client.on('data', (c) => chunks.push(Buffer.isBuffer(c) ? c : Buffer.from(c))); await once(client, 'end'); assert.equal(Buffer.concat(chunks).toString('utf8'), 'hello\n'); -- 2.51.2