\r\n\u003C/template>\r\n\u003Cscript setup lang=\"ts\">\u003C/script>\r\n```\r\n\r\nApp.vue\r\n```\r\n\u003Ctemplate>\r\n \u003Cdiv>Message: {{ getMessage(\"Hello World\") }}\u003C/div>\r\n\u003C/template>\r\n\u003Cscript setup lang=\"ts\">\r\nimport { getMessage } from \"@/service/message-service\";\r\n```\r\n\r\nApp.test.ts\r\n```\r\nimport { it, expect, vi } from \"vitest\";\r\nimport { mountSuspended } from \"@nuxt/test-utils/runtime\";\r\nimport App from \"../../layouts/default.vue\";\r\n\r\nvi.mock(\"@/service/message-service\", () => {\r\n return {\r\n getMessage: () => \"hello from mock!!\",\r\n };\r\n});\r\n\r\n\r\nit(\"nuxt unit testing\", async () => {\r\n const component = await mountSuspended(App, { route: \"/\" });\r\n expect(component.html()).toMatchInlineSnapshot(\r\n `\"\u003Cdiv>Message: hello Hello World\u003C/div>\"`\r\n );\r\n});\r\n\r\n```\r\n\r\nmessage-service.ts\r\n```\r\nexport function getMessage(message: string): string {\r\n console.log(\"FROM ACTUAL\");\r\n return `hell ${message}`;\r\n}\r\n```\r\n\n\n### Describe the bug\n\nI was expecting vitest vi.mock should be able to mock imports to provide custom/mock implementation, however it seems that vi.mock is not working in the context of nuxt test?\r\n\r\nIf so, how are we suppose to create unit tests and/or E2E using nuxt/test-utils package and be able to provide flexible mocking mechanism?\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2894,2897,2900],{"name":2895,"color":2896},"bug","d73a4a",{"name":2898,"color":2899},"vitest-environment","b60205",{"name":2901,"color":2902},"pending triage","5D08F5",935,"How to mock custom imports while using mountSuspended to test","2024-09-09T02:17:10Z","https://github.com/nuxt/test-utils/issues/935",0.77674913,{"description":2909,"labels":2910,"number":2912,"owner":2869,"repository":2870,"state":2871,"title":2913,"updated_at":2914,"url":2915,"score":2916},"### Environment\n\n------------------------------\r\n- Operating System: Linux\r\n- Node Version: v18.18.0\r\n- Nuxt Version: 3.10.3\r\n- CLI Version: 3.10.1\r\n- Nitro Version: 2.9.3\r\n- Package Manager: npm@10.2.3\r\n- Builder: -\r\n- User Config: devtools, runtimeConfig, modules\r\n- Runtime Modules: @nuxt/test-utils/module@3.11.0\r\n- Build Modules: -\r\n------------------------------\r\n\n\n### Reproduction\n\nhttps://stackblitz.com/edit/nuxt-starter-j9nscj?file=vitest.config.ts\n\n### Describe the bug\n\nHi there,\r\n\r\nduring Migration i came across an issue. I still have some Options API Components which are using `this.$config.public` to access Nuxt Runtime Config.\r\n\r\nIt seems to be working fine but whenever i run vitest i receive the following error:\r\n\r\n`TypeError: Cannot read properties of undefined (reading 'public')`\r\n\r\nAn simple Workaround for this is to simply mock $config globally.\r\nBut shouldn't $config be working out of the box?\r\n\r\nThank you!\r\n\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\nTypeError: Cannot read properties of undefined (reading 'public')\r\n ❯ Proxy.data components/withPublicConfigAccess.vue:7:26\r\n 8| \u003C/template>\r\n 9| \r\n 10| \u003Cscript>\r\n | ^\r\n 11| export default {\r\n 12| data() {\r\n ❯ applyOptions node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3460:30\r\n ❯ finishComponentSetup node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7663:7\r\n ❯ setupStatefulComponent node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7586:5\r\n ❯ setupComponent node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7515:36\r\n ❯ mountComponent node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5845:7\r\n ❯ processComponent node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5811:9\r\n ❯ patch node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5290:11\r\n ❯ ReactiveEffect.componentUpdateFn node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5955:11\r\n ❯ ReactiveEffect.run node_modules/@vue/reactivity/dist/reactivity.cjs.js:181:19\n```\n",[2911],{"name":2901,"color":2902},773,"Access RuntimeConfig via $config returns undefined","2024-03-12T15:10:14Z","https://github.com/nuxt/test-utils/issues/773",0.7802507,{"description":2918,"labels":2919,"number":2924,"owner":2869,"repository":2870,"state":2871,"title":2925,"updated_at":2926,"url":2927,"score":2928},"### Environment\n\nhttps://stackblitz.com/edit/github-shyy23?file=pages%2Fmypage.vue\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-shyy23?file=pages%2Fmypage.vue\n\n### Describe the bug\n\n`expect(useRoute().path).toEqual('/')` fails when `navigateTo('/')` called within page component. Doesn't fail when called directly in test itself.\n\n### Additional context\n\n_No response_\n\n### Logs\n\n_No response_",[2920,2921,2922],{"name":2895,"color":2896},{"name":2898,"color":2899},{"name":2883,"color":2923},"dadada",668,"navigateTo assert not working when triggered inside page","2024-04-29T16:10:06Z","https://github.com/nuxt/test-utils/issues/668",0.78262365,{"description":2930,"labels":2931,"number":2932,"owner":2869,"repository":2933,"state":2934,"title":2935,"updated_at":2936,"url":2937,"score":2938},"Now that TailwindCSS v4 is going stable, we should better support it.\n\n- [x] **Playground**: Add TailwindCSS v4 example. It'd be ideal if we can find a way to keep v3 and v4 in one npm project.\n- [x] **Test**: Test for TailwindCSS v4\n- [ ] Auto enable `experimental.processCSSVariables` if Tailwind v4 is detected (i.e. `@tailwindcss/vite` is installed)",[],468,"fonts","closed","TailwindCSS v4","2025-03-10T13:13:24Z","https://github.com/nuxt/fonts/issues/468",0.7699359,{"description":2940,"labels":2941,"number":2868,"owner":2869,"repository":2945,"state":2934,"title":2946,"updated_at":2947,"url":2948,"score":2875},"",[2942],{"name":2943,"color":2944},"enhancement","1ad6ff","nuxt.com","Show active users on files only on valid branch","2023-02-15T12:31:24Z","https://github.com/nuxt/nuxt.com/issues/342",{"description":2950,"labels":2951,"number":2959,"owner":2869,"repository":2886,"state":2934,"title":2960,"updated_at":2961,"url":2962,"score":2963},"### Environment\n\nWhen navigating to any component on the `ui.nuxt.com` website, it displays a 500 error and fails to show any content.\n\n\n\n### Is this bug related to Nuxt or Vue?\n\nNuxt\n\n### Version\n\nv3.0.2\n\n### Reproduction\n\nhttps://ui.nuxt.com\n\n### Description\n\nWhen using the `ui.nuxt.com` website and navigating to any component, the site 500 errors.\n\n### Additional context\n\nOnly seems to occur on the latest version of firefox, works fine on chrome.\n\n### Logs\n\n```shell-script\n\n```",[2952,2953,2956],{"name":2895,"color":2896},{"name":2954,"color":2955},"v3","49DCB8",{"name":2957,"color":2958},"triage","ffffff",3804,"`ui.nuxt.com` 500 errors","2025-04-08T00:51:08Z","https://github.com/nuxt/ui/issues/3804",0.775044,{"description":2965,"labels":2966,"number":2970,"owner":2869,"repository":2870,"state":2934,"title":2971,"updated_at":2972,"url":2973,"score":2974},"### Environment\n\nReproduction: https://stackblitz.com/edit/github-gu1sj1-xq3xf8?file=tests%2Fe2e%2Fbasic.e2e.test.ts\r\n\r\nA minimal repo with just [vitest](https://github.com/vitest-dev/vitest) and [@nuxt/test-utils](https://github.com/nuxt/test-utils), an app.vue, and a `pages/index.vue` fails with error:\r\n\r\n```js\r\n❯ npm run test\r\n\r\n> test\r\n> vitest\r\n\r\nRunning with compatibility version `4`\r\n\r\n DEV v1.6.0 /home/projects/github-gu1sj1-xq3xf8/app\r\n\r\n ❯ ../tests/e2e/basic.e2e.test.ts (1)\r\n ❯ basic (1)\r\n ⠹ [ beforeAll ]\r\n · contains Welcome to Nuxt! string\r\n\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\n\r\n FAIL ../tests/e2e/basic.e2e.test.ts > basic\r\nError: Cannot find any nuxt version from ./app\r\n ❯ Module.loadNuxt ../node_modules/@nuxt/kit/dist/index.mjs:2729:11\r\n ❯ loadFixture ../node_modules/@nuxt/test-utils/dist/shared/test-utils.C7cWLW4C.mjs:102:14\r\n 100| });\r\n 101| const buildDir = ctx.nuxt.options.buildDir;\r\n 102| if (!existsSync(buildDir)) {\r\n | ^\r\n 103| await promises.mkdir(buildDir, { recursive: true });\r\n 104| ctx.teardown = ctx.teardown || [];\r\n ❯ setup2 ../node_modules/@nuxt/test-utils/dist/shared/test-utils.C7cWLW4C.mjs:178:7\r\n\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯\r\n\r\n Test Files 1 failed (1)\r\n Tests (1)\r\n Start at 09:54:14\r\n Duration 4.84s (transform 445ms, setup 45ms, collect 2.14s, tests 5ms, environment 0ms, prepare 807ms)\r\n```\n\n### Reproduction\n\nhttps://stackblitz.com/edit/github-gu1sj1-xq3xf8?file=tests%2Fe2e%2Fbasic.e2e.test.ts\n\n### Describe the bug\n\nCannot successfully end-to-end test if there is a pages directory with an index.vue.\n\n### Additional context\n\n```\r\n\"dependencies\": {\r\n \"@nuxt/test-utils\": \"^3.13.1\",\r\n \"nuxt\": \"^3.12.3\",\r\n \"vitest\": \"^1.4.0\",\r\n \"vue\": \"latest\"\r\n }\r\n```\n\n### Logs\n\n```shell-script\n❯ npm run test\r\n\r\n> test\r\n> vitest\r\n\r\nRunning with compatibility version `4`\r\n\r\n DEV v1.6.0 /home/projects/github-gu1sj1-xq3xf8/app\r\n\r\n ❯ ../tests/e2e/basic.e2e.test.ts (1)\r\n ❯ basic (1)\r\n ⠹ [ beforeAll ]\r\n · contains Welcome to Nuxt! string\r\n\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯\r\n\r\n FAIL ../tests/e2e/basic.e2e.test.ts > basic\r\nError: Cannot find any nuxt version from ./app\r\n ❯ Module.loadNuxt ../node_modules/@nuxt/kit/dist/index.mjs:2729:11\r\n ❯ loadFixture ../node_modules/@nuxt/test-utils/dist/shared/test-utils.C7cWLW4C.mjs:102:14\r\n 100| });\r\n 101| const buildDir = ctx.nuxt.options.buildDir;\r\n 102| if (!existsSync(buildDir)) {\r\n | ^\r\n 103| await promises.mkdir(buildDir, { recursive: true });\r\n 104| ctx.teardown = ctx.teardown || [];\r\n ❯ setup2 ../node_modules/@nuxt/test-utils/dist/shared/test-utils.C7cWLW4C.mjs:178:7\r\n\r\n⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯\r\n\r\n Test Files 1 failed (1)\r\n Tests (1)\r\n Start at 09:54:14\r\n Duration 4.84s (transform 445ms, setup 45ms, collect 2.14s, tests 5ms, environment 0ms, prepare 807ms)\n```\n",[2967,2968,2969],{"name":2895,"color":2896},{"name":2898,"color":2899},{"name":2901,"color":2902},895,"Adding `/pages/index.vue` breaks e2e testing","2024-07-18T14:13:18Z","https://github.com/nuxt/test-utils/issues/895",0.7762544,{"description":2976,"labels":2977,"number":2979,"owner":2869,"repository":2945,"state":2934,"title":2980,"updated_at":2981,"url":2982,"score":2983},"Respectively to `contact@nuxt.com` / `support@nuxt.com` / `careers@nuxt.com`",[2978],{"name":2943,"color":2944},503,"[Company] `contact` / `support` / `careers` forms should send an email","2023-02-15T12:32:26Z","https://github.com/nuxt/nuxt.com/issues/503",0.77754796,["Reactive",2985],{},["Set"],["ShallowReactive",2988],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$ftFro8ik3PZvTZitgQKiJVaRuq-X3hGOsGC_9HsTun_I":-1},"/nuxt/ui/3147"]