What readers are saying
JavaScript Testing Recipes is both a thorough introduction into the field as well as a practitioner’s handbook that makes for a great reference to keep close by. After reading the book, I can now build test harnesses with confidence.
Jan Lehnardt – CouchDB and Hoodie author and JSConf.eu organiser
JavaScript Testing Recipes is an indispensable guide to designing and testing JavaScript code in every major environment the language now reaches. Its calm, clear, practical advice and comprehensive example code have already saved me hours of frustration by explaining exactly what to do, exactly how to do it, and (crucially) exactly why.
Tom Stuart – author of Understanding Computation
What’s in the package?
- The complete book in PDF, ePub and Kindle formats
- All the example code, ready to run and tinker with
Product information
JavaScript Testing Recipes is for anyone looking to improve the quality of the JavaScript they write. It explains how to create applications from modular components that can be easily tested to make sure they work – now, and in the future.
It covers the full spectrum of problem domains we use JavaScript for today, including chapters on programming in the browser, building server-side apps and command-line programs.
In this book, you will learn how to:
- Master the building blocks of tests: organisation, assertions, mocks, stubs and async
- When and why to apply integration tests or isolated unit tests
- Handle events and streams and check their behaviour
- Build decoupled user interface modules that can be tested individually
- Test your client’s interaction with a JSON API
- Integrate WebSockets on the client and server side with end-to-end tests
- Check your application’s URL routing and navigation flows
- Test code that relies on the current time and the JS timer functions
- Deal with storing data in the browser and with server-side databases
- Work with build tools like Browserify and CoffeeScript
- Run cross-browser tests automatically from the command line
- Build testable web servers in Node and Express
- Refactor server-side code to increase modularity and make testing easier
- Talk to databases using services and ORMs
- Handle authentication and login sessions during tests
- Use headless browsers and browser simulators
- Write command-line applications using unit testing
- Isolate a program from the Unix environment, standard I/O and exit codes
- Test programs that rely on third-party HTTP APIs
Buy now – £19 Money-back guarantee, instant delivery
Free previews
- See the Table of Contents
- Read the sample chapter: Command-line applications