Skip to content

Fix runner detection and rename run_jest_test to run_js_ts_test#2533

Merged
hiroshinishio merged 1 commit intomainfrom
wes
Apr 16, 2026
Merged

Fix runner detection and rename run_jest_test to run_js_ts_test#2533
hiroshinishio merged 1 commit intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Copy Markdown
Collaborator

@hiroshinishio hiroshinishio commented Apr 16, 2026

Summary

  • Bug fix: Runner detection (jest vs vitest) was based on which binary existed in node_modules/.bin/. When both exist (e.g., gitautoai/website has "test": "jest" but vitest binary also installed), the wrong CLI flag was used (--related instead of --findRelatedTests). Now reads the script value from get_test_script_name to determine the actual runner.
  • Rename: run_jest_testrun_js_ts_test and JestResultJsTsTestResult since the function handles both jest and vitest for JS/TS files.
  • get_test_script_name now returns (name, value) tuple so callers can inspect the script value to determine runner.
  • Test data updated to use real package.json scripts from website, ghostwriter, posthog, and circle-ci-test repos.

Social Media Post (GitAuto)

Our test runner had a silent bug. When both jest and vitest binaries existed in a repo, it picked vitest by default and passed --related instead of jest's --findRelatedTests. Tests ran fine locally but failed on repos like our own website where package.json says "test": "jest". Now we read the actual script value instead of guessing from binaries.

… existence

The test runner (jest vs vitest) was determined by which binary existed in
node_modules/.bin/. When both exist (e.g., gitautoai/website has "test": "jest"
but vitest binary also installed), the wrong CLI flag was used (--related instead
of --findRelatedTests). Now reads the script value from get_test_script_name to
determine the actual runner. Also renames run_jest_test → run_js_ts_test since
it handles both runners.
@hiroshinishio hiroshinishio self-assigned this Apr 16, 2026
@hiroshinishio hiroshinishio merged commit ca84c07 into main Apr 16, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch April 16, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant