Create vite server with 'test' mode #642
GalassoLuca
started this conversation in
Ideas
Replies: 2 comments 5 replies
-
I currently use There is #713 released in 0.3.0 which should set mode to |
Beta Was this translation helpful? Give feedback.
4 replies
-
I was opening a new PR while I saw @sheremet-va's commits of the #775, published in v0.4.0 I tested it and it's working as expected! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently migrated more than 5 hundred tests from Jest to Vitest and I'm surprised about Vitests speed and reliability!
While running these tests I need to load env variables and I'm properly doing it by adding them in the
.env
file with theVITE_
prefix as suggested from the doc.In order to clarify which vars are used while testing and which ones are not, I'd like to split them into two different files. This is possible by using VITE mode while creating the Vite server with
createServer
Vite's method used increateVitest
Vitest's method.Currently, in Vitest the mode is not specified and so the default is
development
.Knowing that I can split these variables by creating a
.env.development
file and a.env
file.My concern is: isn't better to specify the mode? Should it be set to
test
or specified in theviteOverrides
param ofcreateVitest
function?Beta Was this translation helpful? Give feedback.
All reactions