Skip to main content
Filter by
Sorted by
Tagged with
3 votes
0 answers
901 views

I'm testing my vue.js 2 project with jest and vue-test-utils, the test works fine, but I've a problem when I try to measure the coverage of .vue files. The problem is that when I execute jest --...
Jose Mac's user avatar
  • 441
3 votes
1 answer
3k views

I'm making a POST API call using ES6 Request() constructor in my vue.js application. The implementation works fine but my test suite (I'm using Jest with vue-test-utils) fails with the below error: ...
Chandan Parthasarathy's user avatar
3 votes
0 answers
702 views

How do you test a button's disabled attribute changing in vue test utils? The disabled attribute of the button depends on isFormValid and isFormModified. I've tried setting them to both true in my ...
pastapareo's user avatar
2 votes
1 answer
3k views

I am testing some Vue 3 components with jest and expect to get an emit when a button is clicked. Now I want to check if the object emitted matches a custom type I created in a different file. e.g.: //...
dmodliba's user avatar
0 votes
1 answer
2k views

After a lot of research I was finally able to test an method with the follow code it('should call myFunction - on Desktop', async () => { const mockMethod = jest.spyOn(myComponent.methods, '...
Amanda Almeida's user avatar
1 vote
1 answer
823 views

I am trying to test vue-router links but the RouterLink does not render, causing the error Cannot call text on an empty DOMWrapper. Test: const mkroute = { params: { test: "a" } }; const ...
sfn's user avatar
  • 413
2 votes
2 answers
1k views

Code sample as below: vue/test-utils failed to trigger events on quasar q-input. I am trying to write a unit test using vue/test-utils and using quasar framework. What I am thinking to test is "a ...
Kiran Mali's user avatar
0 votes
0 answers
578 views

I try to run a test with vue-test-utils, including a component that has a mixin included, which has a function using split() on a string. The test looks like this: describe('adminExample.vue Test', () ...
StevenSiebert's user avatar
1 vote
1 answer
2k views

I'd like to test that a loading placeholder is displayed, while data from the server is fetching inside onMounted hook. Here is the component I'm testing: <template> <section class="...
Lazouski's user avatar
  • 101
1 vote
2 answers
3k views

I have a problem testing transiton functions with jest and vue test utlis. This is my component code: <div class="disclosure"> <button class="label" ...
kr099's user avatar
  • 75
0 votes
1 answer
486 views

I'm trying to write a test that tests the various method calls to other methods within the same file. So far, I've written tests for two different methods, one passes, one does not. async ...
Todd Froisland's user avatar
0 votes
1 answer
891 views

I've got a vue application which exists of a page component and a nested child component, which makes a async post-request. If the request is failing, an error is thrown, which is propagated to the ...
Theiaz's user avatar
  • 844
3 votes
1 answer
1k views

I am not sure how to provide the inject-reactive data when I mount the component. I don't need the exact solution, just a hint would be much appreciated. Here is my parent component: @Component export ...
Shamim Hossain's user avatar
1 vote
0 answers
1k views

I have setup unit testing using installation instructions from https://v1.test-utils.vuejs.org/ Tests are running properly. But the coverage is coming incorrectly. In the report it is showing it has ...
prasadmsvs's user avatar
  • 1,759
1 vote
0 answers
1k views

I have a Vue 3 application and use vue-test-utils for testing. I also use web components. One of the components is an input element that implements an inputChanged event that is triggered in case the ...
Patrick's user avatar
  • 2,285
2 votes
0 answers
1k views

I have several components inside each of them have fields that are validated with vuelidate. All field validation rules are described in the parent component wrapper in the child components, I pass ...
fisher's user avatar
  • 103
1 vote
0 answers
852 views

I'm trying to unit test with Nuxt. Everything's going smoothly, but my problem lies with unit testing fetch. It seems that since this.$axios isn't a library (well, it is, but is injected to the ...
user avatar
5 votes
3 answers
11k views

I am trying to write a test, using vitest, to assert a computed property in a vue3 component that is defined with script setup. Consider a simple component: // simple.vue <script lang="ts"...
Myk Willis's user avatar
  • 12.9k
0 votes
0 answers
401 views

I'm currently exploring unit testing and Vue test utils particularly. I have an external library (vue-toastification) that shows a toast message when something occurs. I'd like to test that this toast ...
Lazouski's user avatar
  • 101
0 votes
2 answers
3k views

Hi i am new in jest and unit testing. i want to ask how to set value text input using vue test utils. shortly I have custom component for text input, its my code <input v-model="...
ikbal maulana's user avatar
0 votes
0 answers
1k views

i am so confused what happens with my code. i am new in jest and unit testing, while developing i use bootstrap-vue, nuxt and vue test utils (jest) for unit testing. Shortly, i have custom component (...
ikbal maulana's user avatar
1 vote
1 answer
507 views

this is how I integrate socket io client from vue main.js import socketIoExt from 'vue-socket.io-extended' import socketIo from 'socket.io-client' Vue.use(socketIoExt, socketIo('http://192.168.1.1:...
Ghed Mendiola's user avatar
1 vote
0 answers
281 views

When I trigger a function that requests API from $socket.client.emit I received client undefined after running npm run test:unit. I used 2 package from Vue when using socket-io here's my code from Vue ...
Ghed Mendiola's user avatar
0 votes
0 answers
1k views

I have been following the Vue school guides on implementing Jest with Vue in order to start writing some unit tests. So far I've installed jest, jest-serializer-vue, vue-template-compiler. module....
John's user avatar
  • 619
1 vote
1 answer
497 views

In my vue config I have the following: configureWebpack: { resolve: { alias: { react: path.resolve(__dirname, 'composition/react'), hooks: path.resolve(__dirname, 'composition'), ...
HMR's user avatar
  • 39.5k

1 2 3
4
5
17