All jobs / Frontend / web developer / Testing

Frontend / web developer interview question · 0–1 years

What is the difference between a unit test, a component test and an end-to-end test on the frontend, and which do you write most of?

The strongest answer

Unit: one function in isolation. Component: render a piece of UI and use it like a user. End-to-end: the real app in a browser. Many of the first two, a few end-to-end on critical paths

Why it works

Right — each level trades speed for realism. Fast tests carry most of the load; a thin end-to-end layer proves the pieces work together.

What a good answer covers

Answers that fall short

Who gets asked this

More Testing questions