惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
博客园_首页
宝玉的分享
宝玉的分享
S
SegmentFault 最新的问题
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
美团技术团队
IT之家
IT之家
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
月光博客
月光博客
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
博客园 - 叶小钗
M
MIT News - Artificial intelligence
B
Blog RSS Feed
有赞技术团队
有赞技术团队
Y
Y Combinator Blog

Show HN

GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: Generate Claude Code Workflows using Spec Driven Development approach Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal).
GitHub - TwistTheoryGames/testpick: Run only the tests yo...
Kazutaka_S · 2026-06-18 · via Show HN

npm CI node license

Run only the tests your diff can actually break.

testpick is a test-selection CLI for JavaScript/TypeScript. It looks at what you changed (git diff) and runs just the tests affected by those changes — turning multi-minute CI runs into seconds.

npx testpick map     # one-time: learn which tests touch which code
npx testpick run     # from now on: run only what your changes affect

Demo

$ testpick map
Mapping 23 test file(s) with vitest in 8 single-pass shard(s).
✔ Map saved to .testpick/map.json — 24 source files tracked.

$ vim src/util.ts        # change one file...

$ testpick run
testpick: 1/23 test file(s) affected by 1 change(s).

 ✓ src/greet.test.ts (1 test) 4ms

$ testpick explain       # ...and see *why*
Changed files (1):
  • src/util.ts
Decisions:
  ✓ src/util.ts  [coverage map → 1 test(s)]
      → src/greet.test.ts
Result: run 1 of 23 test file(s).

Want a GIF for your README/socials? A ready-to-run vhs script lives at demo.tape: brew install vhs && vhs demo.tape.

Why not just vitest --changed / jest --onlyChanged?

Those are great — until your code has couplings their static import graph can't see:

  • a module loaded via a runtime-computed path — a plugin registry, DI container, or import(/* @vite-ignore */ pathFromConfig). Vite can glob a literal import(\./${name}.js`)`, but it cannot analyze a path that's data.
  • code reached only at runtime that the static graph over- or under-counts

testpick builds its map from runtime coverage — what each test actually executed — so it captures those edges. Verified example (see testpick-real fixture):

const REGISTRY = { feat: "../features/feat.ts" };
export const load = (n) => import(/* @vite-ignore */ REGISTRY[n]); // Vite can't see this
Change features/feat.ts result
vitest related features/feat.ts No test files found
testpick run runs loader.test.ts

Note: testpick and Vite's module graph are complementary, not strictly better. A coverage map is more precise for runtime-computed couplings and for trimming imported-but-unexecuted modules; the static graph can flag a yet-to-run branch a coverage map hasn't seen. That's why testpick always errs toward running more (see below) — and why it works the same for Jest, where there's no Vite graph.

Safety first

A test selector is only useful if you can trust it not to skip something important. testpick's rule: when in doubt, run more — never less.

  • Changed a file the map doesn't know about (new file, config)? → it runs all tests by default.
  • Pass --ai and it asks an LLM to narrow those unmapped changes to likely tests — but if the model is unsure, it still falls back to running everything. The AI can never cause a skip.
  • testpick explain shows exactly why each test was selected or skipped.

Commands

testpick map [--base <ref>]      # build/refresh the coverage map
testpick run [--base <ref>]      # run only affected tests
testpick explain [--base <ref>]  # dry-run: print the selection + reasoning
Option Meaning
--base <ref> Diff against a ref (CI: --base origin/main). Default: working tree vs HEAD.
--ai Use an LLM (needs ANTHROPIC_API_KEY) to resolve unmapped changes.
--all Escape hatch: run the whole suite.
--full map only: rebuild from scratch instead of incrementally.
-j, --jobs <n> map only: max concurrent coverage passes (default: CPU count).

Fast maps

testpick map is built for speed three ways:

  • Single-pass (Vitest, default): instead of starting the runner once per test file, testpick shards the files across your cores and runs each shard as one serial Vitest process, attributing V8 precise-coverage deltas to each file. Far fewer startups — measurably faster wall-clock and less total CPU than one-process-per-file. Use --per-file to opt out (Jest uses per-file today).
  • Incremental: each test file is hashed; only changed/new files are re-measured. A no-op refresh is instant; editing one test re-maps just that file.
  • Parallel: the per-file path (and the shards) run up to one lane per CPU (-j to tune).

Use --full to force a clean rebuild. If single-pass can't account for a file (e.g. a project config it couldn't merge), that file falls back to isolated per-file measurement automatically — the map is never silently incomplete.

In CI (GitHub Actions)

- run: npm ci
- run: npx testpick run --base origin/${{ github.base_ref }}

Commit .testpick/map.json to share the map across CI runs, or rebuild it on a schedule.

Status

v0.1 — supports Vitest and Jest. Roadmap: faster single-pass map building, monorepo package-level selection, and more runners/languages.

MIT licensed.