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');