Testing RESTful APIs in AngularJS
Testing is crucial to ensure the quality of any software, and this e-commerce app is no exception. The developers can either waste most of the development time chasing bugs, or investing that time in what really matters: algorithms, business logic, and UX/UI improvements. We are going to use three tools to test our client-side code: Karma and Mocha/Chai/SinonJS for unit testing, and Protractor for end-to-end testing.
Unit testing
In the previous chapter, we implemented some unit testing for Angular and for Node controllers and models.
We are going to continue our unit testing/implementation with the Product service. As we saw in the previous chapters, the service/factory is the module in charge of retrieving, saving, ...
Get Web Application Development with MEAN now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.