You are previewing Secrets of the JavaScript Ninja.

Secrets of the JavaScript Ninja

Cover of Secrets of the JavaScript Ninja by John Resig and Bear Bibeault Published by Manning Publications
O'Reilly logo

Chapter 2. Arming with testing and debugging

This chapter covers

  • Tools for debugging JavaScript code
  • Techniques for generating tests
  • Building a test suite
  • How to test asynchronous operations

Constructing effective test suites for your code is always important, so we’re going to discuss it now, before we go into any discussions on coding. As important as a solid testing strategy is for all code, it can be crucial for situations where external factors have the potential to affect the operation of your code, which is exactly the case we’re faced with in cross-browser JavaScript development.

Not only do we have the typical problems of ensuring the quality of the code, especially when dealing with multiple developers working on a single code base, ...

The best content for your career. Discover unlimited learning on demand for around $1/day.