marilari88 / neotest-vitest

Vitest adapter for Neovim Neotest plugin
92 stars 34 forks source link

✨ Detect vitest dependency in monorepo #41

Closed balzafin closed 6 months ago

balzafin commented 6 months ago

In monorepo setup you typically have multiple package.json files and it's common that a dependency like vitest is only defined in the root. As reported in #30 and #23 this is not currently supported.

This fix seems to be working for my Nx monorepo setup. Additionally I had to change the vitest command:

require("neotest-vitest")({
  vitestCommand = "npx vitest",
})

I copied the solution pretty much as-is from neotest-jest so all glory to guivazcabral.

marilari88 commented 6 months ago

@balzafin Well done! Thank you for your contribution