From 037ed632fddec7d92af85001a8e09aa89ba9051c Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Wed, 1 Apr 2026 15:38:18 -0400 Subject: [PATCH] fix(ci): restore prepack script and stabilize cursor timeout - restore the package prepack hook expected by npm packaging coverage - raise the oversized cursor models test timeout to avoid full-suite flakes --- package.json | 1 + tests/unit/cursor/cursor-models.test.ts | 30 ++++++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 41784d12..515af049 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "ui:build": "cd ui && bun run build", "ui:preview": "cd ui && bun run preview", "ui:validate": "cd ui && bun run validate", + "prepack": "bun run build:all", "prepare": "husky", "postinstall": "node scripts/postinstall.js" }, diff --git a/tests/unit/cursor/cursor-models.test.ts b/tests/unit/cursor/cursor-models.test.ts index a5095b5e..6c5b3cc9 100644 --- a/tests/unit/cursor/cursor-models.test.ts +++ b/tests/unit/cursor/cursor-models.test.ts @@ -159,12 +159,14 @@ describe('fetchModelsFromDaemon', () => { } }); - it('falls back to defaults when daemon response exceeds max body size', async () => { - const oversizedPayload = 'x'.repeat(1024 * 1024 + 1024); - const server = http.createServer((_req, res) => { - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(oversizedPayload); - }); + it( + 'falls back to defaults when daemon response exceeds max body size', + async () => { + const oversizedPayload = 'x'.repeat(1024 * 1024 + 1024); + const server = http.createServer((_req, res) => { + res.writeHead(200, { 'Content-Type': 'application/json' }); + res.end(oversizedPayload); + }); await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve)); const address = server.address(); @@ -172,13 +174,15 @@ describe('fetchModelsFromDaemon', () => { throw new Error('Unable to resolve test server port'); } - try { - const models = await fetchModelsFromDaemon(address.port); - expect(models).toEqual(DEFAULT_CURSOR_MODELS); - } finally { - await new Promise((resolve) => server.close(() => resolve())); - } - }); + try { + const models = await fetchModelsFromDaemon(address.port); + expect(models).toEqual(DEFAULT_CURSOR_MODELS); + } finally { + await new Promise((resolve) => server.close(() => resolve())); + } + }, + 10000 + ); }); describe('fetchModelsFromCursorApi', () => {