Jasmine

Testing AngularJS Directives With Jasmine

Mar 28, 2015

When I first started using Angular one area I was particularly confused about was custom directives, and specifically how to test custom directives. I had a vague notion that directives can interact with the DOM (something which is to be avoided in controllers), but I didn’t really know when to use directives or how to test them (something which is pretty straightforward in controllers).

Read More →

Testing Asynchronous Code With AngularJS and Jasmine

Mar 27, 2015

One of the nice features about Angular is the testability. The dependency injection makes it easy to test components in isolation and stub out dependencies where necessary. However, it is not immediately obvious how to test asynchronous code. To illustrate how this works I am going to create an example (with asynchronous code) and test this using Jasmine.

Read More →

Shared Examples with Jasmine

Sep 20, 2012

On my current project we’re doing quite a bit of JavaScript development using CoffeeScript and the Spine.js framework. Since we practice TDD we’re using Jasmine to drive all our CoffeeScript code and I’ve found it to be a great little framework.

Read More →