Top "Vue-test-utils" questions

Helpers to render VueJS components in unit tests.

How to mock window.location.href with Jest + Vuejs?

Currently, I am implementing unit test for my project and there is a file that contained window.location.href. I …

unit-testing vue.js vuejs2 jasmine vue-test-utils
How to Unit Test a Method in a Vue.js Component using jest

I'm trying to unit test a component method. The question here does not lay out how to access the component …

unit-testing vue.js vuejs2 jestjs vue-test-utils
How do you set the data values in a component with Vue-Test-Utils before mounted is called?

I am using Jest with Vue-Test-Utils. The code I have been using looks like this: beforeEach(() => { wrapper = shallow(GridContainer, { …

vue.js vue-test-utils
Vue test-utils how to test a router.push()

In my component , I have a method which will execute a router.push() import router from "@/router"; // ... export default { // ... methods: { …

vue.js vue-router vue-test-utils
TypeError: Cannot read property 'getters' of undefined

I'm trying to test a basic Vue Component that makes reference to a Vuex store. I thought I followed Vue's …

vue.js vuex vue-test-utils
Setting up Vue computed properties for unit tests with vue-test-utils

vue-test-utils provides a setComputed method that allows you to set the state of a computed property. import { mount } from '@…

unit-testing vuejs2 vue-test-utils
How can I test a custom input Vue component

In the Vue.js documentation, there is an example of a custom input component. I'm trying to figure out how …

vue.js vuejs2 vue-test-utils
VueJS - Unit testing with vue-test-utils gives error - TypeError: _vm.$t is not a function

Relatively new to Vuejs and testing its components. Using vue-test-utils and jest for testing. Getting following error test log The .…

vue.js sass jestjs babel-jest vue-test-utils
Mocking methods on a Vue instance during TDD

I'm learning TDD whilst building my Vue app, and trying to abide by the strict laws of only writing enough …

vue.js vuejs2 tdd jestjs vue-test-utils
vue-test-util click trigger on button not firing

I have a Vue component with a button. On a button click, a method is called. I am using Jest …

javascript vue.js jestjs vuetify.js vue-test-utils