vitest-dev / vscode

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

Cannot find any test #389

Closed vuggy17 closed 3 months ago

vuggy17 commented 4 months ago

Describe the bug

Vscode extension cannot find any test in the repository but the cli run fine.

Reproduction

  1. Open repo: https://github.com/vuggy17/idle2/tree/vite-ext-no-test
  2. Install dependency: pnpm i
  3. Run test (at the root folder): pnm test

Test run successfully but the extension cannot find any test

Output

[INFO 12:01:42 PM] [API] Running Vitest: v1.6.0 (vitest.workspace.ts)
[INFO 12:01:42 PM] [API] Starting Vitest process with Node.js: /run/user/1000/fnm_multishells/8785_1716263711673/bin/node
[Worker] failed to load config from /home/vuggy17/workspace/idle2/vitest.config.ts

Version

v0.10.7

Validations

sheremet-va commented 3 months ago

Vitest cannot load config files that import raw TypeScript syntax. To bypass that, you are using NODE_OPTIONS=\"--import tsx/esm\" in your scripts.

You can add NODE_OPTIONS: --import tsx/esm to vitest.nodeEnv option to replicate that:

// settings.json
"vitest.nodeEnv": {
  "NODE_OPTIONS": "--import tsx/esm"
},