vitest-dev / vscode

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

No Tests found #342

Closed PhilippSalvisberg closed 4 months ago

PhilippSalvisberg commented 4 months ago

Describe the bug

In Version 0.4.1 of the extensions the tests are found. But when I upgrade to version 0.6.0 no tests are found. Running tests via command line works.

Might be related to https://github.com/vitest-dev/vscode/issues/285. However, Tests are found via command line only not shown in the UI of the VS Code extension.

Reproduction

  1. Clone https://github.com/PhilippSalvisberg/js23c
  2. Open sandbox2 folder this project
  3. With version 0.4.1 tests are found with version 0.6.0 no tests are found

Output

Empty output channel. Nothing to show.

Version

0.6.0

Validations

sheremet-va commented 4 months ago
  1. The extension requires Vitest 1.5.0 - https://github.com/vitest-dev/vscode#requirements
  2. Currently, you need to have a config file for the extension to kick in - https://github.com/vitest-dev/vscode#why-is-the-extension-not-activated
PhilippSalvisberg commented 4 months ago

Thanks @sheremet-va . I've updated the dependencies to 1.5.0 and created a vitest.config.ts. Now the VS Code Extension detects the tests.

ffMathy commented 4 months ago

Could we perhaps want to create more user-friendly messages in these cases, so that people will know more intuitively? I feel like this case could happen a lot.

sheremet-va commented 4 months ago

Could we perhaps want to create more user-friendly messages in these cases, so that people will know more intuitively? I feel like this case could happen a lot.

If we could detect this scenario, then we would just start Vitest. The problem is that the extension activates only if there is a config file now:

https://github.com/vitest-dev/vscode/blob/ecdfa216da12fd58c6042ba2cfb245c92001d02c/package.json#L35

If you have a solution in mind, PR is welcome. Ideally, we should detect these tests.