Best way to make projectile-run-test-at-point use Vitest #2103
Replies: 1 comment
|
You can reuse it — Define a Vitest command function and rebind the JS/TS modes: (defun my/test-at-point-vitest-command (file-name test-name)
(format "npx vitest run %s -t %s"
(shell-quote-argument file-name)
(shell-quote-argument test-name)))
(let ((rule '(:node-types ("call_expression")
:name-fn projectile-test-at-point-jest-name
:command-fn my/test-at-point-vitest-command)))
(dolist (mode '(js-ts-mode typescript-ts-mode tsx-ts-mode))
(setf (alist-get mode projectile-test-at-point-rules) rule)))
To verify, put point inside a Note this needs a tree-sitter mode — Since Vitest is jest AP two-line difference, a |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
It seems like jest is hardcoded for frontend projects. I see that I can override
projectile-test-at-point-rules, but it would be nice to reuseprojectile-test-at-point-jest-namesince Vitest is API compatible with jest.Thanks!
All reactions