Testing Vue. js Components with Jest : A Concise Guide to Testing Vue. js Components Using Jest and the Official Vue Test Utils Library

Bok av Alex Jover Morales
Unit test your Vue.js components with this fully-featured JavaScript testing frameworkKey FeaturesUnderstand the various testing styles and their purposeGain insight into how to test methods by avoiding dependenciesExplore snapshot testing and its applicationsBook DescriptionUnit testing in modern component-based JavaScript frameworks is not straightforward. You need a test suite that is reliable and runs quickly. Components are connected to one another, and the browser adds a layer of UI, which makes everything inter-dependent while we test components in isolation. Jest is a fully-featured JavaScript testing framework that will do all your work for you.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 learnSet up a Vue-test project to get started with JestUnit test your components using techniques such as shallow renderingGain insights into how to test the reactive parts in the logic of the Vue.js componentsExplore how to test deeply rendered Vue.js componentsPerform easy and quick tests with module dependency mocking, module aliasing, and moreKnow-how and when to use snapshot testingWho this book is forIf you are a programmer looking to make your development process smooth and bug-free, this is an ideal book for you. Prior knowledge and experience of JavaScript will help you quickly and easily grasp the concepts explained in this book.