Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

TUI: saveResult.queue.test.ts hard-codes POSIX paths, so coverage:tui fails on Windows (not covered by #2748)

オープン 初心者向け
#2,810 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
90/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
cli, testing

調査の方向性

テストファイル clients/tui/tests/saveResult.queue.test.ts は POSIX パスをハードコードしています; node:path から resolve をインポートし、4つの assertions でそれを使用するように編集してください。clients/tui で npx vitest run __tests__/saveResult.queue.test.ts と npm run check を実行します。両方のテストが Windows で通り、POSIX の動作が変わらない場合に完了です。

索引モデルが issue の本文から書いたものです。

説明

Which version line?

v2 — current (@modelcontextprotocol/inspector@latest)

Which client?

TUI

Inspector version

2.12.0 (v2/main at 72126af)

Node version

v24.14.0

Operating system (and browser, for the web client)

Windows 11 Home 10.0.26200 (PowerShell and Git Bash); npm 11.9.0 (CI pins 11.20.0)

Transport

Not applicable / never connected

MCP server under inspection

Not applicable. This is a unit-test failure; no server is involved.

Steps to reproduce
  1. On Windows 11 with Node 24: git clone --branch v2/main https://github.com/modelcontextprotocol/inspector.git, then cd inspector && npm ci
  2. cd clients/tui
  3. npx vitest run __tests__/saveResult.queue.test.ts (or npm run coverage:tui from the repo root)
Expected behavior

Both tests in saveResultToFile queueing (#2571) pass on every platform, because coverage:tui is a stage of npm run local:gate.

Actual behavior

2 of 2 tests fail. saveResultToFile resolves its target with node:path resolve(cwd, path), so with cwd = "/d" the mocked writeFile receives D:\d\a.json, but the test asserts the literal "/d/a.json":

  • starts each write only after the previous one has settled: AssertionError: expected [ 'D:\d\a.json' ] to deeply equal [ '/d/a.json' ]
  • a failed save does not hold up the ones queued after it: AssertionError: expected [] to have a length of 1 but got +0. This one is a consequence, not a second bug: the first test throws before it settles its mocked write, the module-scope saveQueue in src/utils/saveResult.ts stays blocked behind it, and writes is empty in the second test.

Full npm run coverage:tui on Windows: 1 failed file, 2 failed tests of 639. #2748 lists test:scripts, coverage:web and coverage:mcpdo as the Windows failures; this stage is not in it, and the gate chain aborts before reaching it.

Logs, errors, or screenshots
AssertionError: expected [ 'D:\d\a.json' ] to deeply equal [ '/d/a.json' ]
AssertionError: expected [] to have a length of 1 but got +0
Already prototyped a fix?

Prompt (reconstructed: the change was made interactively with Claude Code on my clone, not from one stored prompt; this prompt reproduces it):

In clients/tui/tests/saveResult.queue.test.ts the expected paths are POSIX literals ("/d/a.json", "/d/b.json", "/d/x.json", "/d/y.json") but saveResultToFile in clients/tui/src/utils/saveResult.ts builds its target with node:path resolve(cwd, path), so on Windows the mocked writeFile receives "D:\d\a.json" and both tests fail. Change only the test: import { resolve } from "node:path", add const inD = (name: string) => resolve("/d", name), and use inD("a.json") etc. in the four assertions. Do not change the source, do not skip on win32, do not mock node:path. Then run npx vitest run __tests__/saveResult.queue.test.ts and npm run check in clients/tui, and npm run coverage:tui from the root.

Verified: before, npm run coverage:tui on Windows 11 / Node 24.14 gave 2 failed of 639. After: 48 files, 640 tests pass; coverage S 97.51 / B 94.75 / F 97.68 / L 97.83; npm run check in clients/tui exits 0. On POSIX resolve("/d", "a.json") is "/d/a.json", so the assertions are unchanged there (I could not run Linux locally). The change is 12 insertions and 4 deletions in the one test file. For reference only, it is on my fork (I am not opening a PR, per CONTRIBUTING): https://github.com/modelcontextprotocol/inspector/compare/v2/main...Sonica-B:inspector:v2/fix/tui-save-queue-test-windows-paths

AI disclosure (MCP AI_POLICY.md): this report and the fix were produced primarily with Claude Code running on my machine: the Windows test runs, the root-cause analysis, the 16-line test change, and the drafting of this issue.

Before you submit
  • I searched existing issues and this is not a duplicate.
  • This is not a security vulnerability report (those go through the private advisory process).
主要言語
TypeScript
スター
11.1k
フォーク
1.6k
平均マージ
4時間 56分
マージ済み PR(30日)
155

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/inspector のほかの issue

modelcontextprotocol/inspector の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。