Test-Driving JavaScript Applications (PragProg)

Design and code JavaScript applications with automated tests. Fire up your editor and get hands-on through practical exercises for effective automated testing and designing maintainable, modular code.

Venkat Subramaniam @venkats

Edited by Jacquelyn Carter @jkcarter

Design and code JavaScript applications with automated tests. Fire up your editor and get hands-on through practical exercises for effective automated testing and designing maintainable, modular code.

Start by learning when and why to do manual testing vs. automated verification. Focus tests on the important things, like the pre-conditions, the invariants, complex logic, and gnarly edge cases. Decouple and mock out intricate dependencies like the DOM, geolocation API, file and database access, and Ajax calls to remote servers. Test code that uses Node.js, Express, MongoDB, jQuery, and AngularJS, and use Chai, Istanbul, Karma, Mocha, Protractor, and Sinon. Create tests with minimal effort and run them fast. Then explore end-to-end testing to ensure all parts are wired and working well together.

Don’t just imagine creating testable code, write it.


“Venkat has taken the swamp of JavaScript testing and drained it into a clear pool. A welcome, pragmatic approach to the subject of testing this sometimes tricky platform. Highly recommended.”

–Neal Ford, director/software architect/meme wrangler, ThoughtWorks, Inc.


  • Full details: Search
  • View this book’s portal and details on how to post errata and suggestions here.

Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

2 Likes