Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable warning when opening a project without Vitest #387

Closed
4 tasks done
GRA0007 opened this issue May 19, 2024 · 1 comment · Fixed by #410
Closed
4 tasks done

Disable warning when opening a project without Vitest #387

GRA0007 opened this issue May 19, 2024 · 1 comment · Fixed by #410
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@GRA0007
Copy link

GRA0007 commented May 19, 2024

Describe the bug

Vitest shows a warning every time I open a project that uses Vite but does not use Vitest.

vscode.window.showWarningMessage(`Vitest not found in "${basename(dirname(configOrWorkspaceFile.fsPath))}" folder. Please run \`npm i --save-dev vitest\` to install Vitest.'`)

I do not always use Vitest for various reasons, so I should be able to disable this warning with a setting like vitest.warnIfNotInstalled = false. A button on the warning like "Don't remind me again" could set this setting.

Reproduction

Open any project that uses Vite but does not use Vitest

Output

[INFO 13:50:07] [v0.10.7] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[Error 13:50:07] [API] Vitest not found for file:///Users/*/projects/*/vite.config.ts.
[Error 13:50:07] [API] Failed to start Vitest: No vitest config files found

Version

0.10.7

Validations

@sheremet-va
Copy link
Member

sheremet-va commented May 19, 2024

I don't think it makes sense to have an option to do that, but we should ignore the warning automatically if there is no Vitest config/vitest in package.json dependencies

@sheremet-va sheremet-va added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants