How to fix this error [Vue warn]: Unknown custom element: in unit testing with Jest

You can stub the child components while creating instance. For more information about stubbing components, check out this link.

Try like this, This will resolve your warning!.

const factory = () => {
  return shallowMount(SidebarCMS, {
     stubs: {
      'nuxt-link': true,
      'any-other-child': true
     }
   });
};

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top