You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have joined a project where the Mode expected for running Vitest is vitest, for example, this NPM script from package.json:
vitest * --mode vitest
In this case, Vitest will look for the environment variable file .env.vitest. I would prefer not to have to rename this file as its use is already well established.
I can see that process.env.MODE is present and set to test, but overriding it in settings has no effect; perhaps it is being set after reading settings?
"vitest.nodeEnv": {
"MODE": "vitest"
}
I can confirm that changing the filename to .env.test does allow it to be loaded.
Please provide a means to specify the mode used by the Vitest extension.
Suggested solution
Support a setting like the following:
"vitest.mode": "vitest"
Apply this value to the environment variable MODE, or continue to use the value test if not set.
Thanks for the response, @sheremet-va. Unfortunately as I mentioned in the original post, I already tried to set MODE in vitest.nodeEnv, it looks like it is being ignored by the extension.
Which config are you referring to with regards to defining the mode property?
Clear and concise description of the problem
I have joined a project where the Mode expected for running Vitest is
vitest
, for example, this NPM script frompackage.json
:vitest * --mode vitest
In this case, Vitest will look for the environment variable file
.env.vitest
. I would prefer not to have to rename this file as its use is already well established.I can see that
process.env.MODE
is present and set totest
, but overriding it in settings has no effect; perhaps it is being set after reading settings?I can confirm that changing the filename to
.env.test
does allow it to be loaded.Please provide a means to specify the mode used by the Vitest extension.
Suggested solution
Support a setting like the following:
Apply this value to the environment variable
MODE
, or continue to use the valuetest
if not set.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: