Skip to content

Commit b24691e

Browse files
authored
feat: allow augmenting config.test.env (#5784)
1 parent b881e88 commit b24691e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/config/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,3 +2292,9 @@ This is a low-level option and should be used only for advanced cases where you
22922292

22932293
If you just need to configure snapshots feature, use [`snapshotFormat`](#snapshotformat) or [`resolveSnapshotPath`](#resolvesnapshotpath) options.
22942294
:::
2295+
2296+
### env {#env}
2297+
2298+
- **Type:** `Partial<NodeJS.ProcessEnv>`
2299+
2300+
Environment variables available on `process.env` and `import.meta.env` during tests. These variables will not be available in the main process (in `globalSetup`, for example).

packages/vitest/src/types/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ export interface InlineConfig {
579579
/**
580580
* Custom environment variables assigned to `process.env` before running tests.
581581
*/
582-
env?: Record<string, string>
582+
env?: Partial<NodeJS.ProcessEnv>
583583

584584
/**
585585
* Options for @sinon/fake-timers

0 commit comments

Comments
 (0)