Chapter 10. Debugging and testing
This chapter covers
- Debugging production code using proxies and switches
- Stepping through code with the JavaScript debugger
- Testing with QUnit and Hiro
After all the work of previous chapters, your application is out there in the wild. And yet, despite our commitment to walking you though the pitfalls and perils you might encounter during development, despite our belief that you’re now well prepared to tackle these problems before you encounter them, you’re probably still going to run into issues that we haven’t covered. And when you encounter one of these issues, all you can do is to put on your Sherlock Holmes hat, detect the source of the issue, and solve the problem. Afterward, when the problem is solved, you’ll probably want to make sure that the bug won’t reappear again. These two steps—how to quickly debug issues in your application and how to prevent them from reoccurring—are what our final chapter is about.