env
- Type:
Partial<NodeJS.ProcessEnv> - Default:
{}
Custom environment variables exposed on process.env (and import.meta.env) during tests.
rstest.config.ts
Tests can then read process.env.PRINT_LOGGER:
index.test.ts
In Node Mode, env merges over inherited host process.env values and any changes made in globalSetup. In Browser Mode, host environment variables are not forwarded automatically (only NODE_ENV, RSTEST, and changes from the browser project's own globalSetup are included), and env takes precedence over them.