Fix runner detection and rename run_jest_test to run_js_ts_test#2533
Merged
hiroshinishio merged 1 commit intomainfrom Apr 16, 2026
Merged
Fix runner detection and rename run_jest_test to run_js_ts_test#2533hiroshinishio merged 1 commit intomainfrom
hiroshinishio merged 1 commit intomainfrom
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
node_modules/.bin/. When both exist (e.g., gitautoai/website has"test": "jest"but vitest binary also installed), the wrong CLI flag was used (--relatedinstead of--findRelatedTests). Now reads the script value fromget_test_script_nameto determine the actual runner.run_jest_test→run_js_ts_testandJestResult→JsTsTestResultsince the function handles both jest and vitest for JS/TS files.get_test_script_namenow returns(name, value)tuple so callers can inspect the script value to determine runner.package.jsonscripts 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
--relatedinstead of jest's--findRelatedTests. Tests ran fine locally but failed on repos like our own website wherepackage.jsonsays"test": "jest". Now we read the actual script value instead of guessing from binaries.