Monday, 6 June 2016

WHAT IS KARMA?

Karma is a JavaScript test runner that works by launching different browsers and running tests against each of them. It records the status of each test so you know which tests failed in certain browsers, making cross-browser compatibility testing incredibly easy. Note that you will need to use Karma with Windows to test in Internet Explorer.

STEP 1: INSTALLATION

Install Karma and the necessary plugins using NPM.
# Install Karma using Node
npm install karma --save-dev
You also need to install a few required plugins before you can start using Karma. First download the correct plugin for your chosen testing framework (Jasmine, Mocha, etc.).
# Install Karma plugin for your chosen testing framework
npm install karma-jasmine --save-dev
Also install the launcher plugins for the browsers you want to execute your tests against. There are launcher plugins for all major browsers.
# Install Karma browser launcher plugins
npm install karma-chrome-launcher --save-dev
npm install karma-ie-launcher --save-dev
*Note: The --save-dev option saves the package as a dev dependency to the package.json file

No comments:

Post a Comment