@vue/test-utils Unknown custom element: <router-view>
I found in vue test utils documentation an example how to stub router-view
and router-link
:
import { shallowMount } from '@vue/test-utils'shallowMount(Component, { stubs: ['router-link', 'router-view']})
2021 Update:Now you need to set it into a global property
import { shallowMount } from '@vue/test-utils'shallowMount(Component, { global: { stubs: ['router-link', 'router-view'] }})