AngularJS Miniconf

A single day single track miniconf on AngularJS

Sreenath Nannat


Test Driven Angular JS Development

Submitted Dec 31, 2013

This workshop is for giving a head start on faster, maintainable and behavioural tests for AngularJS using the Jasmine Test Framework and Karma test runner. At the end of the session, the attendees should be able to:

  • Learn about basic unit testing.
  • Use Jasmine and Karma for writing and running tests.
  • Write tests for Angular Routes, Directives, Factories and Controllers.
  • Get an overview of Grunt and Bower.


Writing tests has definite benefits especially in long term. But if we don’t have the right environment and tool set, it can be less fun and frustrating too. In this workshop we will be focusing on setting up the right environment with the right tools which makes test driven development enjoyable and sustainable.

Unit testing is made really easy in AngularJS because of its dependency injection, which allows us to isolate different parts of the system and write unit tests for each of them. We will be using Jasmine as the testing framework and Karma as the test runner.

Jasmine is the most popular unit testing framework for writing behavioural tests. It resembles RSpec, the popular testing framework in the Ruby On Rails world. It comes up with set of helper methods which wraps out all the mundane things, especially the test setup, and helps us focus on testing. Also, it has a pretty clean syntax which helps learning faster.

Karma is a test runner which basically facilitates running tests in our preferred environment, a real browser or a headless browser like PhantomJS. The best part is that it will blend well with most of the major Continuous Integration servers such as Jenkins, Travis etc..

We will also cover tools such as Bower, Grunt, which helps us to run the tests frequently to give us quick and frequent feedback, which is mandatory for unit testing.

Angular JS makes it easy to write unit tests and acceptance tests, But in this workshop we will be covering only unit testing in Angular.


  • Familiarity with Angular JS and Test Driven Development is Preferred.
  • Laptop with your preferred IDE. We will be using Sublime.
  • Git
  • Node.js
  • NG-boilerplage - We prefer this to kickstarting the AngularJS Dev setup including the tools required for TDD

Speaker bio

Leena is the Head of Engineering @ Multunus. She was bitten by the TDD bug a couple of years ago. Having done enough TDD in Ruby/Rails, Javascript and Android, she’s moved onto Continuous Delivery (CD) in a big way - even spoke about CD at DroidCon India 2011 and AgileIndia 2012. She had conducted a workshop on TDD on Android as part of DroidCon India 2013.

Sreenath is a Product Developer @ Multunus. He has experience in technologies like Ruby/Rails, Rubymotion, Javascript and Android. He has been doing TDD with Backbone JS for some time and recently been smitten by AngularJS & has since then dedicated himself to it. He is busy capturing the world in his camera when he’s not coding.


{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hosted by

Miniconfs are miniature conferences. more