Test driven development with Vue.js by Sarah Dayan

31:07 4082 views 98% Published 3 months ago

Testing a component can be counter-intuitive. It requires a mental shift to wrap your head around the differences between testing components and testing plain scripts, knowing what to test and understanding the line between unit and end-to-end tests.

TDD makes everything easier. Instead of writing tests by examining all bits and pieces of a finished project, and trying to guess what you should cover, you’re doing the opposite. You’re starting from actual specs, a list of things that the component should do, without caring about how it does it. This way, you’re ensuring that all you test is the public API of your component, but you’re also guaranteeing you don’t forget anything.

In this talk, we’ll cover why TDD is an ideal method for testing Vue components properly, and we’ll do it together live. We’ll deep dive into why TDD works the way it does, and how it can bring you full confidence over iterating on your Vue projects. At the end of the talk, you will know exactly what to test in your Vue components, and how to do it efficiently.

Link Original video