{"id":18015559,"url":"https://github.com/ehsan-shv/nuxt-jest","last_synced_at":"2026-04-13T00:43:56.178Z","repository":{"id":134259217,"uuid":"383543228","full_name":"ehsan-shv/nuxt-jest","owner":"ehsan-shv","description":"Nuxt-Jest common warnings.","archived":false,"fork":false,"pushed_at":"2021-07-07T15:23:01.000Z","size":196,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T19:01:46.200Z","etag":null,"topics":["jest","nuxtjs","vuejs","vuelidate","vuex"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ehsan-shv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-06T17:06:12.000Z","updated_at":"2021-07-21T09:49:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"cfc3ad05-9c09-4409-b8d8-81269ec02f23","html_url":"https://github.com/ehsan-shv/nuxt-jest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsan-shv%2Fnuxt-jest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsan-shv%2Fnuxt-jest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsan-shv%2Fnuxt-jest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehsan-shv%2Fnuxt-jest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehsan-shv","download_url":"https://codeload.github.com/ehsan-shv/nuxt-jest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198473,"owners_count":20900082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jest","nuxtjs","vuejs","vuelidate","vuex"],"created_at":"2024-10-30T04:14:24.749Z","updated_at":"2026-04-13T00:43:51.129Z","avatar_url":"https://github.com/ehsan-shv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## nuxt-jest common warnings:\n\n```bash\n# install dependencies\n$ npm install\n\n# serve with hot reload at localhost:3000\n$ npm run dev\n\n# run test\n$ npm run test\n```\n---\n\n **1-[Vue warn]: Unknown custom element: \u003cnuxt-link\u003e - did you register the component correctly? For recursive components, make sure to provide the \"name\" option.**\n \n component:\n\n     \u003ctemplate\u003e  \n      \u003cheader class=\"c-header\"\u003e  \n        \u003cnuxt-link to=\"/\"\u003e  \n          Home  \n        \u003c/nuxt-link\u003e  \n      \u003c/header\u003e  \n    \u003c/template\u003e\n\ntest:\n\n    import { mount } from '@vue/test-utils'  \n    import Header from '~/components/Header/Header'  \n      \n    describe('Header', () =\u003e {  \n      test('is a Vue instance', () =\u003e {  \n      const wrapper = mount(Header)  \n      expect(wrapper.vm).toBeTruthy()  \n     })})\nsolution:\n\n    import { mount, RouterLinkStub } from '@vue/test-utils'  \n    import Header from '~/components/Header/Header'  \n      \n    describe('Header', () =\u003e {  \n      test('is a Vue instance', () =\u003e {  \n      const wrapper = mount(Header, {  \n      stubs: {  \n      NuxtLink: RouterLinkStub  \n      }  \n     })  expect(wrapper.vm).toBeTruthy()  \n     })})\n\n**2-[Vue warn]: Error in render: \"TypeError: Cannot read property 'state' of undefined\"**\n\ncomponent: \n\n    \u003ctemplate\u003e  \n      \u003cmain class=\"c-main\"\u003e  \n        \u003ch1 class=\"c-main__title\"\u003e  \n          {{ $store.state.title }}  \n        \u003c/h1\u003e  \n      \u003c/main\u003e  \n    \u003c/template\u003e\n\ntest: \n\n    import { mount } from '@vue/test-utils'  \n    import Main from '~/components/Main/Main'  \n      \n    describe('Main', () =\u003e {  \n      test('is a Vue instance', () =\u003e {  \n      const wrapper = mount(Main)  \n      expect(wrapper.vm).toBeTruthy()  \n     })})\n\nsolution:\n\n    import { mount, createLocalVue } from '@vue/test-utils'  \n    import Vuex from 'vuex'  \n    import Main from '~/components/Main/Main'  \n      \n    const localVue = createLocalVue()  \n    localVue.use(Vuex)  \n      \n    const store = new Vuex.Store({  \n      state: {  \n      title: 'nuxt-jest'  \n      }  \n    })  \n      \n    describe('Main', () =\u003e {  \n      test('is a Vue instance', () =\u003e {  \n      const wrapper = mount(Main, {  \n      localVue,  \n      store  \n      })  \n      expect(wrapper.vm).toBeTruthy()  \n     })})\n**3-[Vue warn]: Missing required prop: \"title\"**\n\ncomponent:\n\n    \u003ctemplate\u003e  \n      \u003cfooter class=\"c-footer\"\u003e  \n        \u003ch2\u003e{{ title }}\u003c/h2\u003e  \n      \u003c/footer\u003e  \n    \u003c/template\u003e  \n      \n    \u003cscript\u003e  \n    export default {  \n      name: 'Footer',  \n      props: {  \n      title: {  \n      type: String,  \n      required: true  \n      }  \n     }}  \n    \u003c/script\u003e\n\ntest: \n\n    import { mount } from '@vue/test-utils'  \n      \n    import Footer from '~/components/Footer/Footer'  \n      \n    describe('Footer', () =\u003e {  \n      test('is a Vue instance', () =\u003e {  \n      const wrapper = mount(Footer)  \n      expect(wrapper.vm).toBeTruthy()  \n     })})\n\nsolution:\n\n    import { mount } from '@vue/test-utils'  \n      \n    import Footer from '~/components/Footer/Footer'  \n      \n    describe('Footer', () =\u003e {  \n      test('is a Vue instance', () =\u003e {  \n      const wrapper = mount(Footer, {  \n      propsData: { title: 'footer' }  \n     })  expect(wrapper.vm).toBeTruthy()  \n     })})\n\n**4- [Vue warn]: Error in render: \"TypeError: Cannot read property '[property name]' of undefined\". ([Vuelidate](https://vuelidate.js.org/))**\n\ncomponent:\n\n    \u003ctemplate\u003e  \n      \u003caside class=\"c-side\"\u003e  \n        \u003cinput  \n      v-model.trim=\"$v.name.$model\"  \n      type=\"text\"  \n      placeholder=\"name\"  \n      \u003e  \n      \u003c/aside\u003e  \n    \u003c/template\u003e  \n      \n    \u003cscript\u003e  \n    import { required } from 'vuelidate/lib/validators'  \n      \n    export default {  \n      name: 'Side',  \n      data () {  \n      return {  \n      name: ''  \n      }  \n     },  validations: {  \n      name: {  \n      required  \n      }  \n     }}  \n    \u003c/script\u003e\n\ntest:\n\n    import { mount, createLocalVue } from '@vue/test-utils'  \n    import Side from '@/components/Side/Side'  \n      \n    describe('Side', () =\u003e {  \n      test('is a Vue instance', () =\u003e {  \n      const wrapper = mount(Side)  \n      expect(wrapper.vm).toBeTruthy()  \n     })})\n\nsolution:\n\n    import { mount, createLocalVue } from '@vue/test-utils'  \n    import Side from '@/components/Side/Side'  \n    import Vuelidate from 'vuelidate'  \n      \n    const localVue = createLocalVue()  \n      \n    localVue.use(Vuelidate)  \n      \n    describe('Side', () =\u003e {  \n      test('is a Vue instance', () =\u003e {  \n      const wrapper = mount(Side, {  \n      localVue  \n      })  \n      expect(wrapper.vm).toBeTruthy()  \n     })})\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehsan-shv%2Fnuxt-jest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehsan-shv%2Fnuxt-jest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehsan-shv%2Fnuxt-jest/lists"}