Testing Vue.js Components with Jest

Morales, Alex Jover

  • 出版商: Packt Publishing
  • 出版日期: 2019-10-17
  • 售價: $1,110
  • 貴賓價: 9.5$1,055
  • 語言: 英文
  • 頁數: 88
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1839219688
  • ISBN-13: 9781839219689
  • 相關分類: Vue.js
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

商品描述

Unit 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.

  • 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