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
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.
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