Jump to ratings and reviews
Rate this book

AngularJS Testing Cookbook

Rate this book
Eliminate volatile code by taking control and understanding how to test AngularJS applicationsAbout This BookLearn how to build a solid and more reliable AngularJS codebase through test-driven development using clearly defined recipesUnderstand how to set up and configure your development environment for unit and end-to-end testing of AngularJS applicationsOver 50 hands-on recipes to help you build a solid foundation in AngularJSWho This Book Is ForThis book is intended for developers who have an understanding of the basic principles behind both AngularJS and test-driven development. You, as a developer, are interested in eliminating the fear related to either introducing tests to an existing codebase or starting out testing on a fresh AngularJS application. If you’re a team leader or part of a QA team with the responsibility of ensuring full test coverage of an application, then this book is ideal for you to comprehend the full testing scope required by your developers. Whether you’re new to or are well versed with AngularJS, this book will guarantee a complete understanding of your application code and help reduce the cost of bugs.

What You Will LearnInstall and configure all required tools and dependencies to begin testing your AngularJS applicationUnderstand the anatomy of a unit test and integrate core fundamentals to begin testing AngularJSDiscover navigation and routing using both the AngularJS router and the ui-router libraryExplore how to test controllersAnalyze test directives and user-based interactionExplain the uses of spies and test eventsTest services using mocks and spiesAnimate test cases, both synchronously and asynchronouslyIn DetailAngularJS stepped up to offer a comprehensive solution to frontend development with minimal dependencies and a clear set of objectives.

This book follows the AngularJS philosophy and offers guidance on how to approach testing components that make up the AngularJS framework. At the start of the book, you will explore how to configure your system to run unit and end-to-end tests. Following this, you'll become familiar with fundamental principles on testing AngularJS with Jasmine. Then, you'll understand how spies can enable you to test your code with greater coverage and simplicity throughout your application. The final result is an AngularJS application that is tested with integrity, helping facilitate a cleaner and more reliable codebase.

180 pages, Kindle Edition

First published March 30, 2015

2 people are currently reading
14 people want to read

About the author

Simon Bailey

25 books1 follower

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
1 (16%)
4 stars
2 (33%)
3 stars
2 (33%)
2 stars
1 (16%)
1 star
0 (0%)
Displaying 1 of 1 review
Profile Image for David.
134 reviews22 followers
June 16, 2015
This cookbook covers a broad range of testing material and additional resources for JavaScript testing, and does a few things better than any other resource out there. I don't think you'll find a more thorough set of tutorials on using Protractor (whose online documentation has always been a bit lacking), covering multiple chapters instead of just the single-chapter throw-in that I've seen in two other Angular books. The author covers testing with both Jasmine (unit testing) and Protractor (end-to-end testing) and establishes a great rhthmn through repeated examples (isn't that what a cookbook is all about?) and helping to paint a clear picture when one is the better tool than the other for testing a particular type of feature in your applications. Additionally, this book is full of links to useful articles and interesting little tools (like Brunch) that I'd never heard of before.

The first couple chapters serve as a great introduction to testing tools and how to work them into your current setup. I appreciated that he took the time to walk through configuring protractor to run with both grunt and gulp, which can be a bit of a nightmare to get right so that it runs correctly and runs for everyone on your team that wants to verify code coverage. It's definitely worth your while too, to check out many of the links he provides on tools like Brunch and Angular Debaser, as they can potentially be great add-ons.

I would have liked to have seen some discussion on organization of test suites and centralizing mock objects for large scale applications, as tests can become horribly disorganized and messy as the project grows. Also, sinon could have used a bit of discussion too, as some shops are making use of it due to its unique features; still many things that Jasmine doesn't yet do as well as it does. Aside from that I think this was an extremely thorough study of Angular testing that's full of great recipes.
Displaying 1 of 1 review

Can't find what you're looking for?

Get help and learn more about the design.