2 years ago

Problems when testing Vue and Vue Router using Jest

Posted 2 years ago by alex


I recently tried to use Jest for testing my Vue application. Everything is working just fine if I’m testing a component in isolation. Although, I have some problems with tests where the vue-router is integrated. I don’t know how to set the starting url so that the right component is rendered correctly.

Here is a Gist with the example code:

In the comments are also the error messages that I receive when running the tests.

Please sign in or create an account to participate in this conversation.