January 2016
Intermediate to advanced
278 pages
4h 53m
English
Karma is a popular test runner for JavaScript, it works with many other testing libraries and frameworks such as Jasmine and Mocha. The Node test runner that comes with Jasmine is fine; however, Karma adds superpowers to the equation.
With Karma, you can run your tests on real web browsers such as Google Chrome, Firefox, Opera, and so on. Once Karma is set and running, it will take care of lookup for the files to test, run it, and then give you a report.
You will need to install Karma before starting to work with it:
$ npm install --save-dev karma karma-jasmine karma-browserify karma-chrome-launcher karma-spec-reporter
Then, you can configure Karma with a script named karma.conf.js:
// Karma configuration // http://karma-runner.github.io/0.12/config/configuration-file.html ...
Read now
Unlock full access