From ef1889f5e116d1cfde5f75c29e4f8f53800852c9 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 18 Apr 2024 16:31:47 -0400 Subject: [PATCH] docs: advise correct extension for vitest config (#26845) --- docs/1.getting-started/11.testing.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/1.getting-started/11.testing.md b/docs/1.getting-started/11.testing.md index 729b830bea..111f7e8bc5 100644 --- a/docs/1.getting-started/11.testing.md +++ b/docs/1.getting-started/11.testing.md @@ -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.