-
-
Notifications
You must be signed in to change notification settings - Fork 112
Closed
vitest-dev/vitest
#5476Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
If env variables are defined in the vitest config files, they are undefined when using the extension
Reproduction
vitest.workspace.ts
export default [
'packages/*'
]vitest.config.mts
import { defineProject } from 'vitest/config'
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineProject({
plugins: [tsconfigPaths()],
test: {
env: {
DATABASE_URL: "http://localhost:3000",
}
}
});test('should successfully login and set access token', () => {
// Act
const database_url = process.env.DATABASE_URL!;
}System Info
System:
OS: Linux 6.6 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
CPU: (10) arm64 unknown
Memory: 4.69 GB / 7.75 GB
Container: Yes
Shell: 5.1.4 - /bin/bash
Binaries:
Node: 20.12.0 - /usr/local/share/nvm/versions/node/v20.12.0/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 10.5.0 - /usr/local/share/nvm/versions/node/v20.12.0/bin/npm
pnpm: 8.15.5 - /usr/local/share/nvm/versions/node/v20.12.0/bin/pnpmUsed Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)