Over the past few years of my career, I wrote a lot of bad tests. I'm confident that the tips and principles in this book will help you avoid the mistakes I've made in the past.
Mocking can lead to a very tight coupling of tests to implementation details of the tested code. By using Preconditions, we can work against that.
Although Cypress offers network request mocking capabilities out of the box, using it with the Mock Service Worker library enables us to use the same…
Mocking JavaScript modules is very powerful. But it leads to omitting parts of our application in tests. The Mock Service Worker library enables us to…
As a rule of thumb, we should refrain from mocking parts of our application if we can avoid it. But in some cases, mocking is preferable and, in my…
Writing tests from the perspective of users, results in a huge advantage: our users don't know anything about its internals. Testing from a user's…
1
We are configuring Cypress to run tests after automatically changing our application's code, localizing Cypress helper functions, and writing our first…
This chapter will focus on setting up a standard Vue project with Vite and adding a basic configuration for testing. First we start with the directory…
See all

Good Tests for Vue Applications