Skip to content

Commit

Permalink
feat: allow augmenting config.test.env (#5784)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored May 29, 2024
1 parent b881e88 commit b24691e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2292,3 +2292,9 @@ This is a low-level option and should be used only for advanced cases where you
If you just need to configure snapshots feature, use [`snapshotFormat`](#snapshotformat) or [`resolveSnapshotPath`](#resolvesnapshotpath) options.
:::
### env {#env}
- **Type:** `Partial<NodeJS.ProcessEnv>`
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).
2 changes: 1 addition & 1 deletion packages/vitest/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ export interface InlineConfig {
/**
* Custom environment variables assigned to `process.env` before running tests.
*/
env?: Record<string, string>
env?: Partial<NodeJS.ProcessEnv>

/**
* Options for @sinon/fake-timers
Expand Down

0 comments on commit b24691e

Please sign in to comment.