JSFoo 2014

JavaScript as the centerpiece of a complex web stack

Leena S N

Leena S N


Test Driven Javascript

Submitted Aug 5, 2014

This workshop is for giving an overview on how to write faster, maintainable and behavioural tests for Javascript using the Jasmine Test Framework and Karma Test Runner. The workshop will cover the following:

  • Introduction to Jasmine
  • Use Karma for running Tests
  • Stubbing and Mocking using libraries such as Sinon.JS
  • Tools such as Grunt and Bower for packaging and building
  • Integration with Continuous Integration servers such as Jenkins, Travis CI etc.

If time permits we will also cover:
- Using Jasmine and Karma test driving applications which uses frameworks such as AngularJS, Backbone etc.


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.

We will be using Jasmine as the testing framework and Karma as the test runner. Jasmine is one of the most popular unit testing framework for writing behavioural tests. It resembles RSpec, the popular testing framework in the Ruby 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 in faster learning.

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.


  • Laptop with your preferred IDE. We will be using Sublime/Atom.
  • Familiarity with Javascript.
  • Familiarity with Git

We will setup a git repo with all the required dependencies that people can clone and use during the workshop.

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 workshops on TDD on Android, TDD on AngularJS and during DroidCon 2013 and Angular JS Miniconf 2014.

Hiemanshu is a Software Architect @ Multunus. At Multunus, we’ve been working on a lot of interesting projects, and doing Continuous Delivery[CD] across a lot of platforms. We have also been working on a platform for faster UX feedback, SeaWeed. I love contributing to Open Source projects and have contributed to projects like CyanogenMod, Fedora, KDE, Qt. I have conducted workshops and given talks about contributing to CyangenMod and Fedora. I am also an avid gamer and love playing all kinds of games.


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

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

{{ errorMsg }}

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