Repository navigation
Run Vitest tests through neotest - #18
Merged
Merged
Conversation
The frontend's Vitest tests had no neotest adapter, so the <leader>T maps found nothing in .test.ts/.tsx files. Add neotest-vitest, with Windows workarounds verified against devel-frontend: - run node_modules/.bin/vitest.cmd; the extensionless script can't be started on Windows - return Windows paths from root() and in parsed results; mixed C:/ and C:\ paths meant tests weren't found from a monorepo root and every result read as failed (marilari88/neotest-vitest#90, unmerged #74) - run from the package directory so Vitest loads vite.config.ts (globals etc.); the plugin's brace glob doesn't expand on Windows Also add nvim-treesitter to neotest's -u NONE parsing subprocess so it gets filetype aliases (typescriptreact -> tsx); without it .tsx test files show no tests (nvim-neotest/neotest#630, #631). The smoke test checks every language has a neotest adapter. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 90315f97-7c82-4bc1-9bf1-2f8460782554
SimonKimDev
marked this pull request as ready for review
October 19, 2026 05:18
…x-nvim-config-bugs # Conflicts: # tests/smoke.lua
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.
The frontend (
devel-frontend, Vitest 5) had no neotest adapter, so<leader>Tr/<leader>TF/<leader>Tsfound nothing in.test.ts(x)files. I missed this in #9.Adding neotest-vitest alone isn't enough on Windows. Each workaround below was a failure I reproduced against devel-frontend:
lazy/testing.luanode_modules/.bin/vitest, a shell script Windows can't startvitestCommandreturnsvitest.cmdC:/…, neotest IDs useC:\…(marilari88/neotest-vitest#90, unmerged #74)Devel), IDs mixC:/…\src\…and match nothingroot()returns Windows pathstest is not defined): config lookup uses a{vite,vitest}.config.*brace glob that Windowsglob()doesn't expand, so Vitest runs from the wrong dir withoutvite.config.tscwd= nearestpackage.jsondir.tsxfiles show no tests: neotest parses in a-u NONEchild that never registers nvim-treesitter'stypescriptreact → tsxalias (nvim-neotest/neotest#630, #631; broke with treesittermain)plugin/filetypes.luaAll Windows-only, commented with the upstream issues, and removable once those land.
Tested with Neovim 0.12.6 against devel-frontend, starting Neovim in both
DevelandDevel\devel-frontend:readingTime.test.ts3/3 passed;AppRoutes.test.tsx9/9 passed (was 0 found)Independent of #17.