marilari88 / neotest-vitest

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

Doesn't work with workspaces or sub dependencies #30

Open DrSammyD opened 1 year ago

DrSammyD commented 1 year ago

Tried using with a workspace based mono repo. I had to delete the package.json dependency checks in my fork to get this plugin to work. May want to refactor how you determine if vitest is actually being used. Package sniffing seems like a suboptimal method.

Perhaps just traversing up the tree till you get to the root project and inspecting the node_modules for a vitest folder would be more robust.

seannetlife commented 8 months ago

Could you please share your workaround?

For reference, here is my workspace folder config:

|- packages
|  |- foo
|     |- src
|     |  |- my-tests.test.ts
|     |- package.json (does NOT contain vitest dependency)
|
|- package.json (contains vitest dependency)
|- vite.config.ts
|- vitest.setup.js