I am new with JEST and have received the above warning. I want to know which is the alternative since is being deprecated.
Here is the test that I am making:
it('is instantiated', () => {
expect(wrapper.isVueInstance()).toBeTruthy();
});
I am new with JEST and have received the above warning. I want to know which is the alternative since is being deprecated.
Here is the test that I am making:
it('is instantiated', () => {
expect(wrapper.isVueInstance()).toBeTruthy();
});
Here's how to rigorously check VueInstance
it('is instantiated', () => {
expect(wrapper.vm).toBeTruthy();
});
I have checked https://vue-test-utils.vuejs.org/api/wrapper/#isvisible and they say:
Assert Wrapper is Vue instance.
So the final thing would be:
it('is instantiated', () => {
expect(wrapper).toBeTruthy();
});
The right answer should be the following:
it('is instantiated', () => {
expect(wrapper.exists()).toBeTruthy();
});
From test/specs/wrapper/find.spec.js
in vue-test-utils repository,
you can see that when wrapper doesnt exists they assert Wrapper
object with exists()
.
it('returns empty Wrapper with error if no nodes are found', () => {
const wrapper = mountingMethod(Component)
const selector = 'pre'
const error = wrapper.find(selector)
expect(error.exists()).toEqual(false)
expect(error.selector).toEqual(selector)
})