Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Vue.js 2

You're reading from   Learning Vue.js 2 Learn how to build amazing reactive web applications easily with Vue.js

Arrow left icon
Product type Paperback
Published in Dec 2016
Publisher Packt
ISBN-13 9781786469946
Length 334 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Olga Filipova Olga Filipova
Author Profile Icon Olga Filipova
Olga Filipova
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Going Shopping with Vue.js FREE CHAPTER 2. Fundamentals – Installing and Using 3. Components – Understanding and Using 4. Reactivity – Binding Data to Your Application 5. Vuex – Managing State in Your Application 6. Plugins – Building Your House with Your Own Bricks 7. Testing – Time to Test What We Have Done So Far! 8. Deploying – Time to Go Live! 9. What Is Next? A. Solutions to Exercises

Why unit tests?


Before we start writing unit tests, let's try to understand what we're trying to achieve by writing them. Why is unit testing so important? Sometimes when I write my tests, the only thing I can think about is my code coverage; I want to achieve a level of 100%.

Code coverage is a very important metric and helps a lot to understand the code flow and what needs to be tested. But it is not a metric of unit test quality. This is not a metric of a good code quality. You can have your code 100% covered just because you call all your functions in your testing code, but if your assertions are wrong, the code might be wrong as well. Writing good unit tests is an art that requires time and patience. But when your unit tests are good enough and when you are concentrating on making good assertions, with regard to corner cases and branch coverage, they provide the following:

  • Help us to identify failures in algorithms and logic
  • Help us to improve the code quality
  • Make us write code that is...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image