@quasar/testing (jest) components not registered when VueRouter not created

  • When I want to mock $route or $router, I can’t create a VueRouter, otherwise these are read-only props.

    In test/jest/utils/index.js, mountQuasar, if I replace
    const router = new VueRouter()
    const router = {}
    I’m able to change $route and $router in my test files.

    But then I get errors warnings while testing, ex:
    [Vue warn]: Unknown custom element: <q-page> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
    even if they are registered in quasar.conf.js

    However the test passes. But I feel like messing up my code.

    Is there a way to properly register the components in such a case ? Or do I have to accept these warnings ?

  • Any news to this error/warning?

Log in to reply