When you have the treesitter tsx language installed (or gets automatically installed in my case) the :TestNearest fails due to ft_to_lang(filetype) returning tsx and not typescript finding no matching query for the runner. This short circuits and returns {} and runs tests against the whole file.
Solution
Add tsx to list of languages jest runner
Not sure how to run any of the tests locally to ensure there are no breaking changes but looking at the jest runner spec there doesn't appear anything this would break.
Issue
When you have the treesitter
tsx
language installed (or gets automatically installed in my case) the:TestNearest
fails due toft_to_lang(filetype)
returningtsx
and nottypescript
finding no matching query for the runner. This short circuits and returns{}
and runs tests against the whole file.Solution
tsx
to list of languages jest runnerNot sure how to run any of the tests locally to ensure there are no breaking changes but looking at the jest runner spec there doesn't appear anything this would break.