vitest-dev / vscode

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

Vitest v1.2.0 is not supported. Vitest v1.4.0 or newer is required. #405

Closed nukeop closed 4 months ago

nukeop commented 4 months ago

Describe the bug

I'm getting this message when I'm loading any repo with certain vitest versions, e.g. ^1.2.0, it doesn't show the buttons to run individual tests. Tests ran from CLI work fine. There is nothing preventing the extension from working with earlier versions in principle, as there are no breaking changes. Breaking compatibility without a very good reason is troublesome.

Changing the "1.4.0" in the extension code to a lower number such as "1.0.0" reveals this is an arbitrary requirement; the extension works fine with lower versions of vitest. It causes unnecessary problems for people who don't want or can't upgrade vitest.

Reproduction

  1. Install vitest with any version lower than 1.4.0, at least v1.2.0 reproduces this.
  2. Load it in vs code with this extension.

Output

[INFO 21:55:40] [v0.10.7] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.

Version

v0.10.7

Validations

sheremet-va commented 4 months ago

Vitest 1.4.0 added a lot of useful APIs for the extension to work properly, like locations to point to the correct line in the test. We did a poll on Twitter to see the percentage of people who are using the extension with what version, and the results showed us that we can require the higher version.

nukeop commented 4 months ago

I don't use Twitter and can't participate in twitter polls, as I imagine many people do. My test where I simply replaced the required version in the extension code and did nothing else made it work. As far as I can see it runs my tests and there are no errors. So why not let us run the tests anyway?

sheremet-va commented 4 months ago

Because showing test icons in test files is one of the main features and we can't just not have it for certain people - instead of answering to you in this PR, I would have to answer to more people in even more PRs if we allowed that.

For the twitter poll, we looked at the percentage of people who use the latest version, so the number of counts didn't matter.