docs: add a description for .env.test (#29398)

This commit is contained in:
Ryota Watanabe 2024-10-13 05:31:29 +09:00 committed by GitHub
parent 04e5828687
commit bb6b6e254d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,6 +68,10 @@ When importing `@nuxt/test-utils` in your vitest config, It is necessary to have
> ie. `vitest.config.m{ts,js}`. > ie. `vitest.config.m{ts,js}`.
:: ::
::tip
It is possible to set environment variables for testing by using the `.env.test` file.
::
### Using a Nuxt Runtime Environment ### Using a Nuxt Runtime Environment
By default, `@nuxt/test-utils` will not change your default Vitest environment, so you can do fine-grained opt-in and run Nuxt tests together with other unit tests. By default, `@nuxt/test-utils` will not change your default Vitest environment, so you can do fine-grained opt-in and run Nuxt tests together with other unit tests.