Skip to content

Commit

Permalink
docs: remove outdated statement
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Sep 13, 2023
1 parent ba1e733 commit b75f91d
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions docs/api/vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,6 @@ import.meta.env.MODE = 'test'
```
:::

:::warning
Vitest transforms all `import.meta.env` calls into `process.env`, so they can be easily changed at runtime. Node.js only supports string values as env parameters, while Vite supports several built-in envs as boolean (namely, `SSR`, `DEV`, `PROD`). To mimic Vite, set "truthy" values as env: `''` instead of `false`, and `'1'` instead of `true`.

But beware that you cannot rely on `import.meta.env.DEV === false` in this case. Use `!import.meta.env.DEV`. This also affects simple assigning, not just `vi.stubEnv` method.
:::

## vi.unstubAllEnvs

- **Type:** `() => Vitest`
Expand Down

0 comments on commit b75f91d

Please sign in to comment.