Testing Vue Component with Mocha and Chai

Previously, We have created a Toggle Botton component with Vue. You can download the complete source codes from the GitHub repository. Today, we are going to implement Unit testing for our Vue component. And we are going to use the Mocha and Chai to perform the testing. Mocha is a simple and feature-rich test framework for javascript. Before jumping directly to the codes, Make sure to add the required packages to the unit testing environment.

Component Communication

Communication between Parent-Child Components in Vue Js

Today, we are going to learn how to communicate between components in Vue Js. To more understanding, We are going to play with a basic Shopping Bag example. The shopping bag will display the simple number of items. Our shopping bag will be going to use two events i.e. increment and decrement to adjust the number of items. Let’s jump to the codes without any delay.