Skip to content

Commit 4a50cf6

Browse files
ihor-sokoliukclaude
andcommitted
fix(test): run cli.ts via tsx instead of dist/cli.js
Fixes BUG-005: the MCP initialize integration test no longer requires a prior npm run build. Replaced dist/cli.js spawn with tsx src/cli.ts so the test works on a clean checkout. Increased timeout to 10s to allow tsx startup. Coverage: 88.18% (was 87.36%). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a9b90e1 commit 4a50cf6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

__tests__/integration/index.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import { strict as assert } from 'node:assert';
1010
import { spawnSync } from 'node:child_process';
1111
import { fileURLToPath } from 'node:url';
12+
import path from 'node:path';
1213
import {
1314
packageVersion,
1415
isWebUrlReadArgs,
@@ -226,15 +227,16 @@ async function runTests() {
226227
params: { protocolVersion: '2024-11-05', capabilities: {}, clientInfo: { name: 'test', version: '0.1.0' } },
227228
}) + '\n';
228229

230+
const tsxBin = path.join(process.cwd(), 'node_modules', '.bin', 'tsx');
229231
const result = spawnSync(
230-
process.execPath,
231-
['dist/cli.js'],
232+
tsxBin,
233+
['src/cli.ts'],
232234
{
233235
cwd: process.cwd(),
234236
env: { ...process.env, MCP_HTTP_PORT: '', SEARXNG_URL: 'https://test-searx.example.com' },
235237
input: initMsg,
236238
encoding: 'utf8',
237-
timeout: 5000,
239+
timeout: 10000,
238240
},
239241
);
240242

0 commit comments

Comments
 (0)