NuxtN
Nuxt12mo ago
8 replies
Yuri

Jest: Property '$style' does not exist on type 'Vue'

Hello.
There is a project in Nuxt 2.
I have a component is module CSS :
 <div :class="$style.test"></div>

And I want to check that this class exist. My test is:
const wrapper = shallowMount(ComponentFindError)
    expect(wrapper.classes()).toContain(wrapper.vm.$style.test)

But I recieve the error:
Property '$style' does not exist on type 'Vue'. 

What is correct way to check if such class exists?
Was this page helpful?