Testing AngularJS with Karma-Jasmine (part 1)

Martín Villero

Unit testing as the name implies is about testing individual units of code. Unit tests try to answer questions such as "Did I think about the logic correctly?" or "Does the sort function order the list in the right order?"


A small, short and ugly step by step:

  1. sudo npm install -g generator-karma
  2. sudo npm install grunt-karma
  3. sudo npm install -g node-gyp
  4. https://github.com/karma-runner/grunt-karma
  5. npm install grunt-karma --save-dev
  6. npm install karma-jasmine --save-dev
  7. npm install karma-phantomjs-launcher --save-dev
  8. Configure karma.conf.js (http://nathanleclaire.com/blog/2013/12/13/how-to-unit-test-controllers-in-angularjs-without-setting-your-hair-on-fire/)
  9. Download files (https://code.angularjs.org/1.0.6/)


I know that it's short, but every good story has a humble beginning... follow us to see the second part!

How to contact us

Our Location

DireccionArismendi 1420 Of. 102 Telefono(+598) 2409 15 66 Mailinfo@vairix.com

Follow us

Want to contact us?