Assigning import.meta.env.VITE_MY_BOOLEAN = false in the test sets it to the string 'false' instead. Code that relies on the parsed import.meta.env to be the literal boolean now fails.
This is the recommended approach from the vitest documentation: https://vitest.dev/guide/mocking.html#mock-import-meta-env
Assigning
import.meta.env.VITE_MY_BOOLEAN = falsein the test sets it to the string 'false' instead. Code that relies on the parsed import.meta.env to be the literal boolean now fails.This is the recommended approach from the vitest documentation: https://vitest.dev/guide/mocking.html#mock-import-meta-env