Vitest for Vue Developers: Testing in the Age of AI
Plans from $25/month

This lesson is for members. Join us?

Subscribe now to get instant access to this course, plus a full library of Vue.js courses tailored to the plan you choose.

Good Application Architecture And Testing (Units, Seams, and Contracts)

A poorly architected Vue app is a nightmare to test: everything depends on everything else, so a Vitest suite can’t check one thing without setting up the whole world. A well-architected app is simpler to test because it’s broken into distinct units with clear boundaries (ie. seams) and each seam has a contract for what goes in and what comes out.

In this lesson you’ll learn the testing vocabulary that the rest of the course uses: units (a distinct responsibility), seams (where two units meet), and contracts (the inputs and outputs that make the meeting go well). You’ll see how seams let you test a unit in isolation by faking whatever sits on the other side so that tests stay fast, focused, and resistant to breaking for unrelated reasons.

Links