Answer the question
In order to leave comments, you need to log in
How to automatically generate tests for all vue components?
There is an application on vue, I set up basic configs, linters, git hooks and that's it.
There is no paid time allocated for the tests. But without tests, the whole application will grow into one big (giant) pain. I want to stop her a little.
I'm sure there are tools to generate test files for each component. At least it's simple whether the component is rendered or not (with an error).
Or. for example, there are multiple events, hover and click. And the test checks the work of the handler when the event fires.
In fact, in a test, this is boilerplate: trigger an event and check the result (for example, as in the docs: https://vue-test-utils.vuejs.org/guides/#testing-k...
Googled that this is called "coverage tests", but to automatically - nothing.
Not to check completely all application after each minimum editing.
In general, is it possible to somehow automatically cover the existing components with tests through the console command?
The meaning of my question is to go through all the components with a tool, check the test coverage, and if there is none for the component, generate it. Is there such a thing, is it possible?
Answer the question
In order to leave comments, you need to log in
Look towards testing with snapshots. It seems that jest can, I don’t know how it works with vue.
But in general:
Not to check completely all application after each minimum editing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question