\n\n### Workaround\nUsing `defineVitestConfig` and hoisting the configuration up to root works fine. Unfortunately I'd need to run three Vitest tasks and couldn't make use of the `projects` functionality.\n\nFor example:\n\n```\npnpm vitest --config vitest.browser.config.ts\npnpm vitest --config vitest.unit.config.ts\npnpm vitest --config vitest.e2e.config.ts\n# 😔\n```\n\n---\n\nSo, I can't figure out how to get it working. I've tried different combinations, singular projects, and using the deprecated `workspaces` key. The method `defineVitestProject` isn't documented and I've read through the code and I'm not really sure why I'm getting an error.\n\n### Nuxt Info\n\n```\n- Operating System: `Darwin`\n- Node Version: `v22.14.0`\n- Nuxt Version: `3.17.5`\n- CLI Version: `3.25.1`\n- Nitro Version: `2.11.12`\n- Package Manager: `pnpm@10.11.1`\n- Builder: `-`\n- User Config: `compatibilityDate`, `modules`\n- Runtime Modules: `@nuxt/test-utils/module@3.19.1`\n- Build Modules: `-`\n```\n\n### Additional information\n\n- [x] Would you be willing to help implement this feature?\n- [ ] Could this feature be implemented as a module?\n\n### Final checks\n\n- [x] Read the [contribution guide](https://nuxt.com/docs/community/contribution).\n- [x] Check existing [discussions](https://github.com/nuxt/nuxt/discussions) and [issues](https://github.com/nuxt/nuxt/issues).",[2907],{"name":2908,"color":2909},"pending triage","5D08F5",1322,"nuxt","test-utils","open","Support Vitest `projects` option for Browser Mode","2025-06-18T13:51:03Z","https://github.com/nuxt/test-utils/issues/1322",0.6437415,{"description":2919,"labels":2920,"number":2922,"owner":2911,"repository":2912,"state":2913,"title":2923,"updated_at":2924,"url":2925,"score":2926},"### Environment\n\n------------------------------\n- Operating System: Windows_NT\n- Node Version: v22.13.1\n- Nuxt Version: 3.17.4\n- CLI Version: 3.25.1\n- Nitro Version: 2.11.12\n- Package Manager: npm@11.4.1\n- Builder: -\n- User Config: -\n- Runtime Modules: -\n- Build Modules: -\n------------------------------\n\n### Reproduction\n\n[repo](https://github.com/zfeher/github-lznt1ajz#) - runs when checked out locally (`npm i && npm t`)\n[stackblitz](https://stackblitz.com/~/github.com/zfeher/github-lznt1ajz) - doesn't run for some reason, maybe something related to the stackblitz template provided by this issue creation tool.\n\n\n### Describe the bug\n\nWhen we are in a monorepo with multiple packages (regulars, nuxt layers) and we want to run tests from root the nuxt layer package tests are failing because nuxt features doesn't work (no auto import, no layer aliases, ...).\n\nAt root level we have a plain vitest config using `defineConfig` and setting `workspace` option. This correctly picks up individual package _vitest.config.ts_ files. Nuxt layer packages use `defineVitestProject`.\n\nRunning `npm t` in the actual nuxt layer packages everything works as it should (nuxt features are working).\n\nIt is also interesting that we had to install `nuxt` at root level, but maybe that is fine.\n\nAnother interesting thing we noticed that each nuxt layer package runs test from all layers which we don't want so added exlude patterns in those vitest configs.\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[2921],{"name":2908,"color":2909},1307,"Vitest workspaces in a monorepo doesn't work.","2025-05-28T13:02:25Z","https://github.com/nuxt/test-utils/issues/1307",0.67143786,{"description":2928,"labels":2929,"number":2933,"owner":2911,"repository":2912,"state":2934,"title":2935,"updated_at":2936,"url":2937,"score":2938},"If I do not include a `nuxt.condfig.ts` in my root and configure vitest like so:\r\n```\r\nimport { fileURLToPath } from 'node:url'\r\nimport { defineVitestConfig } from 'nuxt-vitest/config'\r\n\r\nexport default defineVitestConfig({\r\n test: {\r\n coverage: {\r\n reportsDirectory: '../coverage',\r\n provider: 'c8',\r\n include: ['src/**'],\r\n exclude: ['src/**/*.spec.ts', 'src/**/*.test.ts', 'src/**/*.d.ts'],\r\n all: true\r\n },\r\n environmentOptions: {\r\n nuxt: {\r\n rootDir: fileURLToPath(new URL('./playground', import.meta.url))\r\n }\r\n },\r\n resolveSnapshotPath (path: string, extension: string) {\r\n return path + extension\r\n },\r\n setupFiles: ['./setup.ts']\r\n }\r\n})\r\n```\r\n\r\nI get\r\n```\r\nError: Failed to load nuxt-vitest module. You may need to add it to your nuxt.config.\r\n```\r\n\r\nWhere there is a nuxt config in my module's playground which includes `nuxt-vitest`",[2930],{"name":2931,"color":2932},"vitest-environment","b60205",574,"closed","allow configuring nuxt rootDir and overrides does not appear to work","2023-12-02T00:27:09Z","https://github.com/nuxt/test-utils/issues/574",0.45953697,{"description":2940,"labels":2941,"number":2947,"owner":2911,"repository":2911,"state":2934,"title":2948,"updated_at":2949,"url":2950,"score":2951},"### Environment\n\n- Operating System: Darwin\r\n- Node Version: v18.20.1\r\n- Nuxt Version: 3.6.5\r\n- Nitro Version: 2.5.2\r\n- Package Manager: yarn@4.1.0\r\n- Builder: vite\r\n- User Config: srcDir, buildDir, modules, ssr, nitro, serverHandlers, css, components, imports, build, builder, typescript, vue, hooks\r\n- Runtime Modules: @nuxt/test-utils/module@3.12.0\r\n- Build Modules: -\n\n### Reproduction\n\nUnfortunately I could not reproduce this behaviour in a fresh repo.\n\n### Describe the bug\n\nUsing `defineVitestConfig` from `@nuxt/test-utils` gives me some errors on random(?) test files located in a specific folder (`./src/plugins/` in this case). It seems that vitest doesn't find those tests inside this directory (`No test suite found in file /omniweb/gsd/src/plugins/frontend-commons.spec.ts`). I tried to place a simple `test.spec.ts` inside with a basic test but it doesn't pick that up either.\r\nHowever if I move those test files to another directory at the same level it runs those test. If I rename the folder to `plugins` it again does not run those test files...\r\n\r\nI really can't imagine what's going on here. Are there some forbidden path patterns for some reason?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2942,2945],{"name":2943,"color":2944},"3.x","29bc7f",{"name":2908,"color":2946},"E99695",26898,"`defineVitestConfig` from `@nuxt/test-utils` is not a drop-in replacement for `defineConfig` from `vite` (`No test suite found in file`)","2024-04-23T07:13:27Z","https://github.com/nuxt/nuxt/issues/26898",0.61502963,{"description":2953,"labels":2954,"number":2957,"owner":2911,"repository":2911,"state":2934,"title":2958,"updated_at":2959,"url":2960,"score":2961},"### Environment\r\n\r\n- Operating System: `Linux`\r\n- Node Version: `v18.9.0`\r\n- Nuxt Version: `3.0.0-rc.11`\r\n- Nitro Version: `0.5.4`\r\n- Package Manager: `npm@8.19.1`\r\n- Builder: `vite`\r\n- User Config: `build`, `css`, `modules`, `runtimeConfig`\r\n- Runtime Modules: `@nuxt/image-edge@1.0.0-27716498.4c23770`\r\n- Build Modules: `-`\r\n\r\n### Reproduction\r\n\r\nApologies, cannot provide due to work policies at my organization.\r\n\r\n### Describe the bug\r\n\r\nBasically I cannot find any way to install the Nuxt plugins I've used in my project while setting up the Vitest config for testing.\r\nI've tried to include the paths to my plugins in setupFiles in vitest.config.ts but doing that gave me an error like - Package import specifier \"#build/app.config.mjs\" is not defined in package. Currently this is my config - \r\n\r\n```\r\n// vitest.config.ts\r\n\r\nimport Vue from '@vitejs/plugin-vue';\r\nimport { resolve } from 'path';\r\nimport fs from 'fs'\r\nimport { defineConfig } from 'vitest/config';\r\nimport AutoImport from 'unplugin-auto-import/vite'\r\n\r\nconst NuxtTsConfig = (fs.readFileSync('./.nuxt/tsconfig.json')).toString()\r\nconst tsConfigFormated = JSON.parse(NuxtTsConfig\r\n .replace(/\\\\\"|\"(?:\\\\\"|[^\"])*\"|(\\/\\/.*|\\/\\*[\\s\\S]*?\\*\\/)/g, (m, g) => g ? '' : m))\r\n\r\nconst r = (p: string) => resolve(__dirname, p)\r\n\r\nexport const alias: Record\u003Cstring, string> = {}\r\n\r\nObject.entries(tsConfigFormated.compilerOptions.paths)\r\n .forEach(([key, value]) => {\r\n alias[key] = r(value[0])\r\n })\r\n\r\nexport default defineConfig({\r\n root: '.',\r\n esbuild: {\r\n tsconfigRaw: '{}',\r\n },\r\n plugins: [\r\n Vue(),\r\n AutoImport({\r\n imports: [\r\n 'vue'\r\n ],\r\n dirs: [\r\n './composables',\r\n './components'\r\n ],\r\n dts: true\r\n })\r\n ],\r\n test: {\r\n globals: true,\r\n environment: 'jsdom',\r\n deps: {\r\n inline: [/@nuxt\\/test-utils-edge/],\r\n },\r\n setupFiles: ['./plugins/some-plugin.ts']\r\n },\r\n resolve: {\r\n alias: {\r\n ...alias,\r\n '#imports': r('./.nuxt/imports.d.ts')\r\n }\r\n }\r\n})\r\n```\r\nAnd this is one of the sample tests I tried to ran -\r\n\r\n```\r\n// login.test.ts\r\n\r\nimport { render, screen } from \"@testing-library/vue\";\r\nimport Login from '../pages/login/index.vue'\r\n\r\ndescribe('Login', async () => {\r\n const text = 'Test'\r\n it('should be span element', async () => {\r\n render(Login)\r\n const elem = await screen.findByText(text)\r\n console.log(elem)\r\n expect(elem.nodeName).toBe('SPAN')\r\n })\r\n})\r\n```\r\n@danielroe @pi0 \r\n\r\nThanks\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[2955,2956],{"name":2943,"color":2944},{"name":2908,"color":2946},15004,"No way to install plugins with Vitest in Nuxt 3","2023-12-02T00:33:54Z","https://github.com/nuxt/nuxt/issues/15004",0.6371025,{"description":2963,"labels":2964,"number":2972,"owner":2911,"repository":2911,"state":2934,"title":2973,"updated_at":2974,"url":2975,"score":2976},"### Environment\n\nRootDir: /Users/dev02/dev/temporario/app-nuxt-3\r\n------------------------------\r\n- Operating System: `Darwin`\r\n- Node Version: `v16.14.2`\r\n- Nuxt Version: `3.0.0`\r\n- Nitro Version: `1.0.0`\r\n- Package Manager: `yarn@1.22.10`\r\n- Builder: `vite`\r\n- User Config: `ssr`, `app`, `css`, `windicss`, `build`, `modules`, `experimental`, `components`, `vite`, `runtimeConfig`, `intlify`, `vueuse`, `content`\r\n- Runtime Modules: `@intlify/nuxt3@0.2.4`, `@pinia/nuxt@0.4.6`, `@nuxt/content@2.2.2`, `@vueuse/nuxt@9.6.0`, `nuxt-windicss@2.5.5`, `nuxt-icon@0.1.8`\r\n- Build Modules: `-`\r\n------------------------------\n\n### Reproduction\n\n// app-nuxt-3/test/hoje.test.js\r\n\r\nimport { fileURLToPath } from 'node:url'\r\nimport { describe, expect, it } from 'vitest'\r\nimport { isWindows } from 'std-env'\r\nimport { setup, fetch, $fetch, startServer, createPage, url } from '@nuxt/test-utils'\r\n\r\nawait setup({\r\n rootDir: fileURLToPath(new URL('../../app-nuxt-3', import.meta.url)),\r\n server: true,\r\n browser: false,\r\n setupTimeout: (isWindows ? 240 : 120) * 1000\r\n})\r\n\r\ndescribe('pages', () => {\r\n it('render index', async () => {\r\n const html = await $fetch('/')\r\n expect(html).toContain('Fundação de Esportes DEV')\r\n })\r\n\r\n\r\n\n\n### Describe the bug\n\nHere are the links to the documentation and the example I took to make mine.\r\nhttps://nuxt.com/docs/getting-started/testing\r\nhttps://github.com/nuxt/framework/tree/main/test\r\n\r\nThe issue I'm having is the app is telling me the Url must be from the schema file. I'm in doubt if the Url is wrong when pointing to the application or if the scheme he wants to say is something else. I can't find any examples on the internet that help me.\r\nNote: Remembering that I configured Vitest and use it normally, including together with Pinia. The real problem is when I started testing the Nuxt components themselves. I haven't even started yet.\r\n\r\nError picture:\r\n\r\n\u003Cimg width=\"643\" alt=\"Captura de Tela 2023-01-09 às 10 42 12\" src=\"https://user-images.githubusercontent.com/83841469/211322216-b68c08fa-1f02-4793-9a03-bd8e275439c1.png\">\r\n\n\n### Additional context\n\nIt's my first time writing a bug (I've always been able to solve it by searching), so forgive me if it's not good enough.\n\n### Logs\n\n_No response_",[2965,2966,2969],{"name":2943,"color":2944},{"name":2967,"color":2968},"needs reproduction","FBCA04",{"name":2970,"color":2971},"⛔️ can be closed","484893",12368,"Problem starting @nuxt/test-utils with URL","2023-02-07T07:10:45Z","https://github.com/nuxt/nuxt/issues/12368",0.6398852,{"description":2978,"labels":2979,"number":2983,"owner":2911,"repository":2912,"state":2934,"title":2984,"updated_at":2985,"url":2986,"score":2987},"### Environment\r\n\r\n- Operating System: `Linux`\r\n- Node Version: `v16.14.2`\r\n- Nuxt Version: `3.0.0-rc.8`\r\n- Package Manager: `npm@7.17.0`\r\n- Builder: `vite`\r\n- User Config: `modules`\r\n- Runtime Modules: `vite-plugin-vue-type-imports/nuxt`\r\n- Build Modules: `-`\r\n\r\n### Reproduction\r\n\r\n#### How to recreate\r\n\r\nFor every link:\r\n\r\n1. Open a link.\r\n2. Wait for a development server is start and the Nuxt Welcome page is loaded.\r\n4. Press \u003Ckbd>Ctrl\u003C/kbd> + \u003Ckbd>C\u003C/kbd> in Terminal.\r\n5. Run `npm test`.\r\n\r\n#### Broken\r\n\r\nhttps://stackblitz.com/edit/github-owtwqh-82agcd?file=nuxt.config.ts,modules%2Fvite-plugin-vue-type-imports.ts,app.vue\r\n\r\n##### Load a bundled Nuxt module from the `node_modules` directory\r\n\r\n```ts\r\nexport default defineNuxtConfig({\r\n modules: [\r\n 'vite-plugin-vue-type-imports/nuxt',\r\n ],\r\n});\r\n```\r\n\r\n#### Working\r\n\r\nhttps://stackblitz.com/edit/github-owtwqh-dyj8f8?file=nuxt.config.ts,modules%2Fvite-plugin-vue-type-imports.ts,app.vue\r\n\r\n##### Load a local Nuxt module from the `modules/` directory\r\n\r\n```ts\r\nexport default defineNuxtConfig({\r\n modules: [\r\n '~/modules/vite-plugin-vue-type-imports.ts',\r\n ],\r\n});\r\n```\r\n\r\n### Describe the bug\r\n\r\nThe `vite-plugin-vue-type-imports/nuxt` module added in `nuxt.config.ts` is:\r\n\r\n* works when loaded via `npm run dev`;\r\n* broken if loaded via `npm test` (`nuxt test` or `vitest` with `@nuxt/test-utils-edge`).\r\n\r\n### Additional context\r\n\r\nThe [same Nuxt module code](https://github.com/wheatjs/vite-plugin-vue-type-imports/blob/370fcea9c7a09a0961bdf6e29b0795963034eb1e/src/nuxt.ts) is works with `npm test` if copy-pasted and loaded as a local plugin from the `modules/` directory.\r\n\r\n### Logs\r\n\r\n```shell\r\nERROR TypeError: Invalid URL 22:18:50\r\n\r\n ❯ TypeError.get https:/github-owtwqh-82agcd.w.staticblitz.com/blitz.df64f655701fde45529fa8e152b3842072335b47.js:6:292488\r\n 22:18:50\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\nSerialized Error: { 22:18:50\r\n \"code\": \"ERR_INVALID_URL\",\r\n \"input\": \"//\",\r\n}\r\n```\r\n",[2980],{"name":2981,"color":2982},"bug","d73a4a",345,"Vitest with `@nuxt/test-utils-edge` breaks imported `vite-plugin-vue-type-imports/nuxt` module, but works if same module code is recreated locally","2023-12-02T00:33:10Z","https://github.com/nuxt/test-utils/issues/345",0.64240307,{"description":2978,"labels":2989,"number":2990,"owner":2911,"repository":2912,"state":2934,"title":2984,"updated_at":2991,"url":2992,"score":2993},[],429,"2023-12-02T00:13:09Z","https://github.com/nuxt/test-utils/issues/429",0.64538836,{"description":2995,"labels":2996,"number":2999,"owner":2911,"repository":2911,"state":2934,"title":3000,"updated_at":3001,"url":3002,"score":3003},"### Environment\n\nNuxi 3.0.0-rc.10 14:35:32\r\nRootDir: /home/workspace/app/packages/app/web 14:35:33\r\nNuxt project info: 14:35:33\r\n\r\n------------------------------\r\n- Operating System: `Linux`\r\n- Node Version: `v18.9.1`\r\n- Nuxt Version: `3.0.0-rc.10`\r\n- Nitro Version: `0.5.3`\r\n- Package Manager: `npm@8.19.1`\r\n- Builder: `vite`\r\n- User Config: `-`\r\n- Runtime Modules: `-`\r\n- Build Modules: `-`\r\n------------------------------\n\n### Reproduction\n\n`import { createBackendConfig } from '@mypath/common-api/config/backendConfig'` in your `nuxt.config.ts`\n\n### Describe the bug\n\n Will result in:\r\n\r\n`ERROR Cannot start nuxt: Cannot find module '@mypath/common-api/config/backendConfig'`\r\n\r\nWhich is obvious because, it doesn't know `@mypath` in the context of `nuxt.config.ts`\r\n\r\nIn Vite I can define this for `vite.config.ts` in `tsconfig.node.json` because this tsconfig is responsible for the `vite.config.ts` due to ` \"include\": [\"vite.config.ts\", \"./vite.ts\"],`\r\n\r\nHow do I do in nuxt environment for `nuxt.config.ts` ? \n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2997,2998],{"name":2943,"color":2944},{"name":2908,"color":2946},15202,"how to use imports in nuxt.config.ts via paths ?","2023-01-19T17:46:10Z","https://github.com/nuxt/nuxt/issues/15202",0.6540424,{"labels":3005,"number":3009,"owner":2911,"repository":2911,"state":2934,"title":3010,"updated_at":3011,"url":3012,"score":3013},[3006,3007,3008],{"name":2943,"color":2944},{"name":2908,"color":2946},{"name":2967,"color":2968},14451,"createTest from @nuxt/test-utils-edge can't load nuxt","2023-01-19T17:35:34Z","https://github.com/nuxt/nuxt/issues/14451",0.6542795,["Reactive",3015],{},["Set"],["ShallowReactive",3018],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f_LJDWAauZka5TCuTb0SnJ-_D39fD_6x5PSUPrvrx06Y":-1},"/nuxt/fonts/574"]