Writing tests for javascript with QUnit/Sinon and Karma