Overview
Building complex software application can be made much easier with unit testing – a fact well established in back-end work but often overlooked on the front-end. Yuri Takhteyev will look at some of the tools and techniques for unit testing front end code, focusing on Mocha and Karma. Most of the examples will draw on AngularJS but the main ideas are applicable to other frameworks as well.
Objective
Learn how to write unit tests for front-end code.
Target Audience
Front-end JavaScript developers not currently using unit testing or those experiencing difficulties with unit testing.
Assumed Audience Knowledge
Intermediate front-end JavaScript, no prior experience with front-end unit testing
Five things audience members will learn
- How unit testing benefits the developer
- How to structure applications to make them testable
- How to use Mocha and Karma in unit testing
- How to mock dependencies (and why)
- How to handle asynchronous code