vitest-dev / vscode

VS Code extension for Vitest
https://vitest.dev/vscode
MIT License
764 stars 86 forks source link

Deno Support #528

Open lishaduck opened 1 week ago

lishaduck commented 1 week ago

Clear and concise description of the problem

I use Deno (sometimes) and I also use Vitest (sometimes). As of very recently, I can use them both. However, the vscode extension still uses Node.js to invoke Vitest, so the vitest cli crashes, and the while extension detects tests, they're all grey and won't run.

I'd be more than willing to test a PR. I'd also be willing to write one, but I don't foresee having the time to write one any time soon, so don't expect anything tomorrow 🙃

Suggested solution

Detect if there's a deno.json file (or, perhaps, read the deno.enabled vscode setting?), and run deno run ./node_modules/vitest instead of node run ./node_modules/vitest (the tricky thing is that deno doesn't have a node_modules folder by default, but requiring one seems reasonable to me).

Alternative

Don't officially support Deno.

Additional context

I usually have chose between Vitest and Deno, but, given the status of denoland/deno#23882, I was trying it out. It works great! (except for coverage, which should be fixed in the next Deno release)

Validations

sheremet-va commented 1 week ago

Feel free to open a PR. You can probably reuse the ws channel: https://github.com/vitest-dev/vscode/blob/main/src/api/ws.ts