lecture 9 of 160 completed

Component testing, and where the boundary sits

Cypress can mount a component directly. The senior question is not how, but which tests belong there instead of in E2E.

What you'll learn

  • Which tests belong at component level instead of end to end
  • The boundary rule, in one sentence
  • How to migrate a slow suite without losing coverage

Picture a suite with 180 end-to-end tests for form validation. Each one logs in, navigates to a form, types an invalid value, and checks the error message. The suite takes fifty minutes and most of it is this.

Every one of those tests was checking a component. None of them needed a login, a database, or a page.

Cypress component testing mounts a single component in a real browser, without your application around it:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →