Testing JavaScript is hard. When my team first started writing JavaScript tests we almost gave up several times. We struggled with topics such as the DOM, Ajax requests and asynchronicity. After months of practice we had written hundreds of unit and end-to-end tests. The problem was that we were slowing down. Our tests had become a burden. They were complex, difficult to understand and a chore to maintain. We realised that tests can be a hinderance if not handled properly.

Gradually, through experimentation and trial-and-error we got better. The same way we need to learn how to build large-scale JavaScript applications, we need to learn how to write maintainable, beautiful tests for them. Sadly, there are few good resources for JavaScript developers on the topic.

In this talk I'll share my experience with JavaScript tests, and show the most important patterns we rely on to write simple, beautiful, maintainable and incredibly fast tests.