Learn Everything

Module · Frontend Engineer

Testing Frontend Code

Testing behaviour instead of implementation, and keeping the e2e suite small.

2 topics4 interactive tasks

TOPIC 01

Component Tests

Render it like a user would, query it the way a user would.

What you'll practice

  • Test the Way a User Sees It — guided · beginner
  • Test Behaviour, Not Implementation — practice · intermediate

A command you'll meet

cat ~/tests/component.md

A test that breaks when you rename a variable is a tax, not a safety net. Open the task below for the full walkthrough.

TOPIC 02

E2E & Mocks

The slow suite you keep small, and the network you fake in the fast one.

What you'll practice

  • Keep the E2E Suite Small — practice · intermediate
  • Mock the Network, Not the Code — challenge · advanced

A command you'll meet

cat ~/tests/e2e.md

The end-to-end suite is the most expensive test you own. Open the task below for the full walkthrough.