Y
Y
Yura Komarov2021-05-26 10:43:11
Vue.js
Yura Komarov, 2021-05-26 10:43:11

How to test router file in vue app?

Hello everyone, please tell me how to test a file containing all routes, and in particular lines 19 and 24?
Testing with jest.
60adfbdec1557932825255.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2021-05-26
@Yurajun

So what exactly do you want to test? Check that exactly the component that is needed is returned? Import your routes. Check that the component field is set. If component = is a function, execute. If the function returned a promise, wait for it to resolve. Having received the final component, compare with the expected result.
Read more
https://vue-test-utils.vuejs.org/en/guides/using-w...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question