
Testfinder
io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 3, 2026
從匯入對映中查詢與某個原始檔相關的測試,按排名排列,並附上執行命令。
AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。
原文描述
Find the tests relevant to a source file from an import map, ranked, with the run command.
概覽
Testfinder 的本機 MCP 服務;無需登入;STDIO。
暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Testfinder,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
testfinder
Running the whole test suite after every small edit is a slow loop. testfinder narrows it: give it one source file plus the project's file/import map — every file's path and the paths it imports — and it works out which tests are actually relevant to that file, why each one is relevant, and the exact command that runs just those tests:
- Direct importers — test files that import the source file themselves, at distance 1.
- Naming-convention matches — test files whose path is
the source path with
.testor.specinserted before the final extension, either beside the source (src/foo.ts→src/foo.test.ts) or in the__tests__form (src/__tests__/foo.test.ts). A source whose name has no extension gets the suffix appended instead (src/foo→src/foo.test). - Transitive importers — test files that reach the source through other files, each at its shortest import distance, so a diamond in the graph resolves to the shorter route.
Every relevant test carries exactly one reason, decided by
precedence: self (the source file is itself a test) over
direct over convention over transitive. Results are
ranked by that reason order, then by distance, then by
path, and run_command is the npx tsx --test line that
runs them in ranked order — or null when nothing is
relevant. The result also reports total_files and
test_files_considered, the count of test files in the
set whether relevant or not. A file counts as a test when
its name carries .test. / .spec. (or ends in .test /
.spec), or when it lives under a test, tests, or
__tests__ directory.
Imports that name paths outside the supplied set are
external: they are ignored, never followed, and never an
error. Duplicate import entries are de-duplicated and a
file importing itself is ignored for graph purposes, though
distances still flow through ordinary non-test files on
the way to a test. Malformed input — a missing or unknown
source_file, an empty file set, a duplicate file path, a
wrongly typed field — is a validation error naming the
offending path (for example
files[1].imports[0] must be a string), and no partial
result is produced. The computation is pure and local,
and the tool only finds tests: running them, with the
command it returns, is left to your own environment.
CLI
args.json contains the full arguments object:
imports defaults to [] per file; here react is
external to the set and ignored. src/foo.test.ts is a
naming-convention match with no import of its own, and
src/bar.test.ts reaches the source through src/bar.ts
at distance 2. The result is printed as JSON:
Exit codes: 0 on success, 1 on a runtime error (including
an unreadable or invalid input file, or invalid input), 2
on a usage error.
MCP server
MCP client config:
Tools
-
find_relevant_tests— Find the tests relevant to one source file from a file/import map.source_file(string, required) — path of the source file; must be one of the supplied filesfiles(array, required, at least one) — files as{path, imports?}objects;pathis unique across the set, and eachimportsentry either names another supplied file or anything else (external, ignored)
Returns
{source_file, relevant_tests, total_files, test_files_considered, run_command}, where each entry ofrelevant_testsis{path, reason, distance}.
Docker
Development
License
MIT — Copyright (c) 2026 Rene Turcios
來源:README.md,提交 5419b88
工具
0版本歷史
1- v0.1.0最新Nov 3, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分