JavaScript and the Pyramid

JavaScript testing in the browser can be a bit strange at first because we’re combining two worlds we previously kept separate: unit testing and the UI.

images/js/down.png

The UI tests, as we’ve defined them thus far, generally go end-to-end. Which is what makes them so great for testing end-to-end functionality.

But UI tests don’t always have to go end-to-end. In fact, often it’s better, and faster, to run them locally within the UI itself. This is exactly what we are doing here when we write our JavaScript tests.

Now to be clear, these are two different kinds of tests. End-to-end UI tests, sitting at the top of the pyramid, cut through ...

Get The Way of the Web Tester now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.