No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. avorias5
    3. Posts
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 0
    • Groups 0

    Posts made by avorias5

    • RE: [0.15.1] Components registering within Jest tests

      Using the same settings as @Akaryatrh

      import Quasar, * as All from 'quasar'
      import { shallow, createLocalVue } from '@vue/test-utils'
      import Component from '/my/Component/
      
      const localVue = createLocalVue()
      localVue.use(Quasar, {components: All, directives: All, plugins: All})
      
      const wrapper = shallow(Component, {
        localVue
      })
      

      The problem is that the wrapper.html() now returns undefined. So wrapper.find() and wrapper.findAll() always fail.

      I’ve play around with the settings and found that if I use

      localVue.use(Quasar, { directives: All, plugins: All})
      

      Without using components, the wrapper.html() would act normally.
      If use components: All or components: ["A", "B" .. ], the wrapper.html() will become undefined.
      However, we have to use Quasar components, otherwise Jest will throw the “component not registered correctly” error.

      Does anyone facing the same problem? Can you guys successfully use wrapper.html(), wrapper.find() and wrapper.findAll() with this settings?
      @vinstah @Jaxon @Akaryatrh

      posted in Help
      A
      avorias5