In this article, we’ll look at how to write unit tests with the Vue Test Utils library — Lifecycle and Async Tests. With the Vue Test Utils library, we can write and run unit tests for Vue apps easily.
With the Vue Test Utils library, we can write and run unit tests for Vue apps easily.
In this article, we’ll look at how to write unit tests with the Vue Test Utils library.
When we call
shallowMount to mount our components, the lifecycle methods will be run.
destroyed methods won’t be triggered unless the component is manually destroyed with
The component won’t be automatically destroyed at the end of each test, so we have to clean up any dependencies manually.