I am new to unit testing, for a start I decided to cover all the components with snapshot tests. I’ve set everything up and everything would seem fine, but when I run the npm run unit command, a warning appears mistake

The tests themselves pass, but it seems to me that because of this warning snapshots are incorrectly stored. Here is the test code

import { mount } from '@vue/test-utils' import Button from '../../components/button.vue' test('renders correctly', () => { const wrapper = mount(Button); expect(wrapper.element).toMatchSnapshot() }) 

How do I make friends with the jest c Vuetify? help me ...)

    1 answer 1

    Jest has the ability to specify a setup script that will run before the test runs. Make the following in this file (pseudocode):

     import Vue from "vue"; import Vuetify from "vuetify"; Vue.use(Vuetify); 

    Should help.

    • Thank you, kind person, helped) - Vladimir Lipodat
    • No doubt)) - yarkov_aleksei