Replies: 3 comments 1 reply
-
I guess something broke with how Vitest handles env 🤔 I will investigate later when I will have time. |
Beta Was this translation helpful? Give feedback.
-
Answered here: #1148 |
Beta Was this translation helpful? Give feedback.
-
I case someone still has the problem, that env variables from a .env.development file do not get loaded, make sure, that you run vitest with the |
Beta Was this translation helpful? Give feedback.
-
The premise that vitest shares the config of vite is powerful. However I am struggling to make this work where the use of
import.meta.env
is used. For example, I have a.env
file like this (following the docs):And a Vue component that looks like this:
This works perfectly well. However if I write a unit test to verify that the title is correct, the test fails because
appTitle
is blank.Beta Was this translation helpful? Give feedback.
All reactions