Skip to content
Codemap
Esc
navigateopen⌘Jpreview
On this page

affected-tests

Find tests likely affected by changed source paths.

Reverse dependency walk from changed sources → test files that import them (or match test detection). Not a verdict — CI composes the runner and exit policy.

Prefer the CLI/MCP convenience verb (builds changed_files for you):

codemap affected --json
git diff --name-only origin/main | codemap affected --stdin --json
codemap affected src/lib/cache.ts --json
codemap affected --changed-since origin/main --json

Recipe form (when you already have paths):

codemap query --json --recipe affected-tests --params changed_files=src/lib/cache.ts

Multiple paths for query_recipe / recipe params are joined with ASCII RS (char 30) — the affected verb handles that.

Params

Param Required Default Notes
changed_files yes Project-relative paths (RS-delimited when multiple)
test_glob no SQLite GLOB on files.path; replaces default *.test.* / *.spec.* suffix globs when set. Empty string keeps test_suites only.
max_depth no 50 Max reverse-dependency hops (0 = only directly-changed test files)

Rows

Each row: test_path, impact_depth (0 = the test file itself changed). Catalog: codemap query --recipes-json.

Last updated on July 20, 2026

Was this page helpful?