Jump to ratings and reviews
Rate this book

JavaScript Testing Recipes

Rate this book
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

253 pages, ebook

First published March 24, 2014

7 people are currently reading
75 people want to read

About the author

James Coglan

2 books23 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
4 (30%)
4 stars
6 (46%)
3 stars
3 (23%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 5 of 5 reviews
5 reviews6 followers
January 29, 2020
I'm not aware of a better book on how to think about testing. Think 'Destroy All Software' in the form of a book. I hope James continues writing.
Profile Image for Matteo Tomasulo.
57 reviews11 followers
April 10, 2016
This book is one of the most complete book on testing ever read.
Pratical and pragmatic on both browser and node development in javascript.

This is a book as the title let guess oriented on a lot of example.
This is ok for a pratical approach on testing but I found principle explanation too much obfuscated and sommerse by a lot of boilerplate code and relative explanation.

Other testing book like The Art of Unit Testing: With Examples in .NET or Test Driven Development: By Example (even if they are of course not specific for javascript platform) are maybe less ready to be applied in pratical but I think that fundamental principle on design and testing are better explained.

My advise is to read that books before and than use this one to apply testing on javascript effectively.
4 reviews17 followers
February 24, 2016
James explains everything so well in the book but he uses the framework he created in his book. Will be extra point if he used something popular like jasmine/mocha
Profile Image for Garren.
44 reviews7 followers
May 17, 2014
Great book on testing, JavaScript and full stack development in JavaScript.
Displaying 1 - 5 of 5 reviews

Can't find what you're looking for?

Get help and learn more about the design.