` and it is also unclear how to import `NuxtIcon` into the test file since we use `\u003CIcon/>` in the markup. Can you please show me how to write tests when using nuxt/icon ?\r\n\r\nI've created a reproduction setup, after installing all deps it will auto start the test and you will see the error.\r\n\r\n\r\nhttps://stackblitz.com/edit/nuxt-vitest-iocqwn\r\n\r\nBest regards",[],197,"icon","[QUESTION] How to write tests for components that use @nuxt/icon","2024-08-20T13:54:55Z","https://github.com/nuxt/icon/issues/197",0.7006551,{"description":2067,"labels":2068,"number":2069,"owner":1994,"repository":2018,"state":2007,"title":2070,"updated_at":2071,"url":2072,"score":2073},"",[],1129,"[Refactor] Harmonize props","2023-02-15T12:31:10Z","https://github.com/nuxt/nuxt.com/issues/1129",0.70368177,{"description":2075,"labels":2076,"number":2069,"owner":1994,"repository":2032,"state":2007,"title":2080,"updated_at":2081,"url":2082,"score":2073},"### Environment\n\n- Operating System: `Linux`\n- Node Version: `v23.5.0`\n- Nuxt Version: `3.15.4`\n- CLI Version: `3.21.1`\n- Nitro Version: `2.10.4`\n- Package Manager: `pnpm@9.15.5`\n- Builder: `-`\n- User Config: `-`\n- Runtime Modules: `-`\n- Build Modules: `-`\n\n\n### Reproduction\n\nhttps://github.com/nuxt/test-utils/pull/1128\n\n### Describe the bug\n\nwhen not using vitest globals and importing and using `vi` and `mockNuxtImport` vitest 3 fails with:\n\n```\nError: [vitest] There was an error when mocking a module. If you are using \"vi.mock\" factory, make sure there are no top level variables inside, since this call is hoisted to top of the file. Read more: https://vitest.dev/api/vi.html#vi-mock\nCaused by: TypeError: Cannot read properties of undefined\n```\n\n### Additional context\n\n_No response_\n\n### Logs\n\n```shell-script\n\n```",[2077],{"name":2078,"color":2079},"pending triage","5D08F5","BUG | vitest v3 | `There was an error when mocking a module` when `mockNuxtImport` with existing `vi` import","2025-02-20T15:35:27Z","https://github.com/nuxt/test-utils/issues/1129",{"description":2084,"labels":2085,"number":2089,"owner":1994,"repository":1994,"state":2007,"title":2090,"updated_at":2091,"url":2092,"score":2093},"Can not figure out and find right solution. Everything not work.\r\n\r\nAfter authentication, i need to save data not only to Store and to localStorage, but also synchronize everything. That after page reload, user will be authed.\r\n\r\nnuxt.conf\r\n```\r\n plugins: [\r\n { src: '~/plugins/localStorage', ssr: false }\r\n ],\r\n\r\n```\r\nlocalStorage.js\r\n```\r\nimport createPersistedState from 'vuex-persistedstate'\r\n\r\nexport default ({store}) => {\r\n createPersistedState({\r\n storage: {\r\n getItem: key => localStorage.getItem(key),\r\n setItem: (key, value) => localStorage.setItem(key, value),\r\n removeItem: key => localStorage.removeItem(key)\r\n }\r\n })\r\n}\r\n\r\n```\r\n\r\nexample.vue component\r\n```\r\n import MyPlugin from '~/plugins/localStorage'\r\n\r\n export default {\r\n created() {\r\n console.log(MyPlugin);\r\n console.log(MyPlugin.local);\r\n console.log(MyPlugin.setting);\r\n// console.log(MyPlugin.storage.getItem('token'));\r\n// console.log(MyPlugin.getItem('token'));\r\n\r\n console.log(this.$store.local);\r\n console.log(this.$store.setting);\r\n },\r\n```\r\n\r\nNothing works\r\n`[HMR] connected\r\nform.vue?385a:89 ƒ (_ref) {\r\n var store = _ref.store;\r\n\r\n Object(__WEBPACK_IMPORTED_MODULE_0_vuex_persistedstate__[\"a\" /* default */])({\r\n storage: {\r\n getItem: function getItem(key) {\r\n …\r\nform.vue?385a:90 undefined\r\nform.vue?385a:91 undefined\r\nform.vue?385a:95 undefined\r\nform.vue?385a:96 undefined`\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2625\">#c2625\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2086],{"name":2087,"color":2088},"2.x","d4c5f9",3031,"Persistedstate LocalStorage not work.","2023-01-18T16:09:51Z","https://github.com/nuxt/nuxt/issues/3031",0.72103864,["Reactive",2095],{},["Set"],["ShallowReactive",2098],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"w2T0PixsrsvW-o24oEdqJeo3fUNRlJNvtzDbZBN2EtM":-1},"/nuxt/nuxt.com/1504"]