Installation/Configuration
As part of the Vue application Preset, the Jest framework will be installed and ready to go out of the box. For further documentation you can follow the link above.
Unit Tests
Unit testing is the process of running tests against the smallest parts of an application. Normally you are testing functions, however in Vue applications, Components are also units to test.
Unit tests are functions that call functions in your source code in isolation and assert that they behave correctly.
Snapshot Testing
Snapshot tests take a picture of your running application to compare it against a previously saved pictures of your application. If the pictures differ, the test fails. This is very useful way to make sure an application continues to render correct after code changes.
What to avoid when testing?
Third-party Libraries Don't test funcitonality that is from another library. Skip it or imitate the implementation if you must have it in order to test your code.
Constants Constants are not changeable, they are a set of static code that is not intended to have variation.
Inline Styles In most cases inline styles do not change the behavior of your component, consequently they should not be tested. The exception is when you are dynamically changing the value(s) of an inline style.
Anything not related to the component being tested You should skip covering any components that are not directly related to the component being tested. Skip testing components that are being imported into the tested component. Don't test the wrapper, analyze and test them separately.