Vitest does not load .env file? #768
-
I'm not sure what I'm doing wrong as my config is note that complex: /// <reference types="vite/client" />
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths()],
test: {
globals: true, // Required for @testing-library
include: ["**/*.test.{ts,tsx}"],
environment: "jsdom",
setupFiles: "./test/setup.ts",
},
}); The env file is located at |
Beta Was this translation helpful? Give feedback.
Answered by
sheremet-va
Feb 16, 2022
Replies: 1 comment 1 reply
-
I think this is a bug. I've tested it with stackltiz and can confirm env is not set: https://stackblitz.com/edit/vitest-dev-vitest-femj7g?file=test/basic.test.ts You can use this as reproduction ^ |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
IgnusG
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this is a bug. I've tested it with stackltiz and can confirm env is not set: https://stackblitz.com/edit/vitest-dev-vitest-femj7g?file=test/basic.test.ts
You can use this as reproduction ^