Skip to main content
Filter by
Sorted by
Tagged with
2 votes
0 answers
1k views

I want to test that the function is called in a simple project. For this, I read the documentation of Vitest - Function and tried to write test as below. However, I keep getting an error that the ...
Mocha_'s user avatar
  • 203
1 vote
0 answers
31 views

I am trying to test this code: template(#item.id='props') router-link(:to='{ name:"ticketDetail", params: { ticketId: props.item.shortId }}') | {{ props.item.shortId }} ...
Amby's user avatar
  • 19
7 votes
0 answers
4k views

I am setting up tests on a Nuxt2 app using @nuxtjs/composition-api and @vue/test-utils. In addition, there is a vue-CLI UI library using @vue/composition-api and vue-demi. The issue is that even if ...
Edith Chevallier's user avatar
0 votes
0 answers
299 views

Helloo! i'm trying to cover 100% of my file with unit tests, but I can't test a function in onMounted() that is called after a async/await promise. using Vue3, Pinia, i18n, Jest and Vue-test-utils. I ...
Wellington Roth's user avatar
0 votes
0 answers
181 views

I'm writing a test using Jest for a Vue application. Now I'm trying to assert whether a certain method is being called when the component is created. For some reason I'm getting back that the method ...
Ricardo de Vries's user avatar
0 votes
1 answer
295 views

I don´t have much experience with unit testing. What is the proper way to test a method imported from a JS file or from another component? This is a sample component I created a localSum just to use ...
Diego Felipe Florença's user avatar
2 votes
0 answers
950 views

DESCRIPTION Hello! I'm working in a quasar project migrating from jest to vitest and my old test were working perfectly, but when i installed vitest one of those test failed even after refactor... It ...
Franyer Higuerey's user avatar
0 votes
1 answer
105 views

I'm running vue3 and testing a vue component using the vue test utils library and in the component i am making an api call like this: const api = this.$http.publisher.fetchValidatedWebsites(); I ...
Oyekeye Sam's user avatar
1 vote
1 answer
598 views

I'm trying to test if a composable's method is called from my store. Here's what I have: /stores/ui: import { defineStore } from 'pinia'; import { useUtils } from '@/composables/utils'; const { ...
Cornwell's user avatar
  • 3,395
1 vote
1 answer
578 views

I have this component: export default class ModalDetails extends Vue { mounted(): void { (this.$refs.modal as any).open(); } } which I am trying to test: describe('ModalDetails', () => ...
H.A.'s user avatar
  • 161
1 vote
0 answers
109 views

I'm runing unit test for vue files. in the vue component i have imported ~/utility/functions file it worked in vue but while testing im getting Cannot find module '~/utility/functions' from 'Compnent....
chougle saud's user avatar
1 vote
0 answers
120 views

I am getting this error when running my test in vue-test-utils this.$options.filters.customCurrency is not a function How can I either stub this as it's not needed or mock the function to prevent the ...
Thomas Harrison's user avatar
0 votes
2 answers
1k views

I am using Vue test utils and Typescript. I have added Data Test ID Plugin. How can I extend VueWrapper interface to avoid this error: Property 'findByTestId' does not exist on type 'VueWrapper<{ $:...
rjurado01's user avatar
  • 5,575
0 votes
1 answer
2k views

I have a vue component that contains a TipTap editor, which I am having problems testing. I am using Vitest with vue-test-utils. This is my component: <script setup lang="ts"> import { ...
Nicole Harris's user avatar
4 votes
2 answers
3k views

I'm trying to mock a call of Nuxt's useLazyFetch() method and let it respond with a .json fixture in a test. The stack I'm using is as follows: vitest 0.22.1 @vue/test-utils 2.0.2 Nuxt 3.0.0-rc.6 ...
S3n's user avatar
  • 131
2 votes
1 answer
14k views

I'm using vue test utils to test a component and getting this error trying to test a text. Cannot call text on an empty DOMWrapper. UPDATED CODE. getting " RangeError: Maximum call stack size ...
Arpit's user avatar
  • 539
0 votes
1 answer
316 views

I have problem with shallowMount in Vue. My function looks like this: describe('ParentComponent.vue', () => { it('renders a ParentComponent', () => { const wrapper = shallowMount(...
Zuzanna 's user avatar
2 votes
0 answers
423 views

I am trying to pass nested slots into my mounted component and I can;'t figure out the syntax, couldn't find anything in docs. What I am trying to do is to add html element into drop-down slot This is ...
Sonny49's user avatar
  • 555
4 votes
2 answers
3k views

I am in the process of converting my project from Vue 2 to 3 and also testing library to Vue test utils 2. Before, mocking methods works like magic: export default { methods: { greet(text) { ...
Wally Jose's user avatar
0 votes
0 answers
235 views

I am trying to write my first Vue unit test, but I am unable to get the data property to change after function runs It runs fine on the UI front I've multiple data objects data() { return { ...
Jackie Chan's user avatar
3 votes
0 answers
759 views

I'm working on unit testing all of my components, and I've hit a bit of a snag (or maybe a misunderstanding of how to properly test). I have a component that receives some parameters from the store, ...
Christopher Fimbel's user avatar
1 vote
1 answer
746 views

I am writing unit test for an existing vue component. The component has a method which runs on mount. The method uses return this.$parent.$parent.someData. I am looking for a way to pass grandparent ...
Manav Mandal's user avatar
0 votes
1 answer
4k views

I'm new to Vue and currently writing unit tests for a search component that I am using in my project. Simply, when the user types in the input field and small X icon appears to the right of the input ...
Lau's user avatar
  • 31
6 votes
3 answers
2k views

I'm writing a jest unit test for my Vuejs 2 (Vuetify) component. Setup is pretty simple. Inside the component I have a prop, which is an object with nested fields: props: ['testObject'] And I have a ...
Vnuuk's user avatar
  • 6,607
0 votes
0 answers
57 views

Okey, I have some test method and lifecycle hook testMethod(){ console.log('test') } beforeMount() { this.testMethod() }, test import {createLocalVue, shallowMount} from "@...
user8327113's user avatar

1 2
3
4 5
17