aboutsummaryrefslogtreecommitdiff
path: root/tests/test-dev-fkeys--f6-test-runner-cmd-for.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-20 23:38:26 -0500
committerCraig Jennings <c@cjennings.net>2026-07-20 23:38:26 -0500
commitce176fd3c4f42cf56d423d6a465d7e45e3fbc4a1 (patch)
treeea4cb5fa6df6dd25af568a23a5509441ce8cfde7 /tests/test-dev-fkeys--f6-test-runner-cmd-for.el
parentf131fa4fb16949ba66d4153fde8b9c95fc407f84 (diff)
downloaddotemacs-ce176fd3c4f42cf56d423d6a465d7e45e3fbc4a1.tar.gz
dotemacs-ce176fd3c4f42cf56d423d6a465d7e45e3fbc4a1.zip
fix(dev-fkeys): run javascript test files through the npx runner
The language detector classifies js/jsx and the test-file detector recognizes JS tests, but the dispatch had no javascript arm, so C-F6 on a JS test errored though the typescript npx path runs it fine. javascript now shares that arm.
Diffstat (limited to 'tests/test-dev-fkeys--f6-test-runner-cmd-for.el')
-rw-r--r--tests/test-dev-fkeys--f6-test-runner-cmd-for.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/test-dev-fkeys--f6-test-runner-cmd-for.el b/tests/test-dev-fkeys--f6-test-runner-cmd-for.el
index d7b6a059..59d0ba42 100644
--- a/tests/test-dev-fkeys--f6-test-runner-cmd-for.el
+++ b/tests/test-dev-fkeys--f6-test-runner-cmd-for.el
@@ -138,10 +138,15 @@ rather than a silent nil that F6's outer wrapper interprets as
'typescript t "src/foo.test.ts" "foo" "src")
"npx --no-install vitest src/foo.test.ts"))))
-(ert-deftest test-dev-fkeys-f6-cmd-for-javascript-returns-nil ()
- "Error: JavaScript is punted for v1 and returns nil."
- (should (null (cj/--f6-test-runner-cmd-for
- 'javascript t "src/foo.test.js" "foo" "src"))))
+(ert-deftest test-dev-fkeys-f6-cmd-for-javascript-uses-npx-runner ()
+ "Normal: javascript gets the same npx runner command as typescript.
+The language detector classifies js/jsx and the test-file detector
+recognizes JS test files, but the dispatch had no javascript arm, so
+C-F6 on a JS test errored even though the npx path would run it."
+ (cl-letf (((symbol-function 'executable-find) (lambda (&rest _) nil)))
+ (should (equal (cj/--f6-test-runner-cmd-for
+ 'javascript t "src/foo.test.js" "foo" "src")
+ "npx --no-install jest src/foo.test.js"))))
(ert-deftest test-dev-fkeys-f6-cmd-for-unknown-returns-nil ()
"Error: an unknown language returns nil."