Skip to content

Add related test selection#3443

Closed
dicnunz wants to merge 1 commit into
avajs:mainfrom
dicnunz:issue-1986-related-tests
Closed

Add related test selection#3443
dicnunz wants to merge 1 commit into
avajs:mainfrom
dicnunz:issue-1986-related-tests

Conversation

@dicnunz

@dicnunz dicnunz commented May 9, 2026

Copy link
Copy Markdown

Fixes #1986.

IssueHunt bounty: https://issuehunt.io/repos/26820798/issues/1986

Summary

  • add --related so positional paths can be treated as changed source files
  • trace configured test files with AVA's existing @vercel/nft dependency tracer
  • run directly changed test files, run dependent tests for known source files, and conservatively run all tests when a changed file is not in the dependency graph
  • document the new command-line mode and cover it with fixture tests

Verification

  • npx test-ava test/related-tests/test.js
  • npx test-ava test/related-tests/test.js test/watch-mode/scenarios.js test/globs/test.js
  • npx tsc --noEmit
  • npx xo (exits 0; existing TODO warnings only)
  • node --check lib/related-tests.js && node --check lib/cli.js && node --check lib/api.js && node --check test/related-tests/test.js
  • git diff --check

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


@avajs avajs locked as spam and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Analyze source & test dependencies to figure out which tests to run (first)

2 participants