docs: advise correct extension for vitest config (#26845)

This commit is contained in:
Nate 2024-04-18 16:31:47 -04:00 committed by GitHub
parent 79b059aaf5
commit ef1889f5e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,6 +59,11 @@ We currently ship an environment for unit testing code that needs a [Nuxt](https
})
```
::tip
When importing `@nuxt/test-utils` in your vitest config, It is necessary to have `type: "module"` specified in your `package.json` or rename your vitest config file appropriatly.
> ie. `vitest.config.m{ts,js}`.
::
### 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.