Testing Vue.js Components with Jest
A concise guide to testing Vue.js components using Jest and the official Vue Test Utils library
About the Book
- Understand the various testing styles and their purpose
- Gain insight into how to test methods by avoiding dependencies
- Explore snapshot testing and its applications
This book shows you how to test Vue.js components easily and take advantage of the fully-featured Jest testing framework with the aid of practical examples. You'll learn the different testing styles and their structures. You'll also explore how your Vue.js components respond to various tests. You'll see how to apply techniques such as snapshot testing, shallow rendering, module dependency mocking, and module aliasing to make your tests smooth and clean.
By the end of this book, you'll know all about testing your components by utilizing the features of Jest.
What you will learn
- Set up a Vue-test project to get started with Jest
- Unit test your components using techniques such as shallow rendering
- Gain insights into how to test the reactive parts in the logic of the Vue.js components
- Explore how to test deeply rendered Vue.js components
- Perform easy and quick tests with module dependency mocking, module aliasing, and more
- Know-how and when to use snapshot testing
Who this book is for
Founded in 2004 in Birmingham, UK, Packt's mission is to help the world put software to work in new ways, through the delivery of effective learning and information services to IT professionals.
Working towards that vision, we have published over 6,500 books and videos so far, providing IT professionals with the actionable knowledge they need to get the job done - whether that's specific learning on an emerging technology or optimizing key skills in more established tools.
As part of our mission, we have also awarded over $1,000,000 through our Open Source Project Royalty scheme, helping numerous projects become household names along the way.
Our students work
with the Best
Become a valued member of Tutorials Point and enjoy unlimited access to our vast library of top-rated Video CoursesSubscribe now
Master prominent technologies at full length and become a valued certified professional.Explore Now