updates an international bestseller to reflect modern development tools and practices. This expanded edition teaches you to write unit tests for async and observable code, as well as methods of faking functions, modules and refactorings. You'll explore test patterns and organization, working with legacy code, and even "untestable" code. The many tool-agnostic examples are presented in JavaScript, and are carefully designed so that they apply to code written in any language.

About the book

guides you step by step from your first simple unit tests to building complete test sets that are maintainable, readable, and trustworthy. Now with examples using JavaScript and Node, this expanded third edition teaches you to write unit tests for async and observable code, as well as methods of faking functions, modules and refactorings. You’ll get to grips with complex subjects such as mocks and stubs, explore how to handle tricky legacy codebases, and save yourself time with tests that function for both frontend and backend applications.is an essential guide for any unit tester who wants to feel confident writing code that’s easier to create, maintain, and adapt.