About
Karma is a javascript test runner that permit to execute test code in multiple real browsers via phantomJs.
Karma is not a testing framework, nor an assertion library. Karma just launches an HTTP server, and generates the test reports on how successful the tests were.
Karma is essentially a tool which spawns a web server that executes source code against test code for each of the browsers connected with another test runner framework.
Articles Related
Testing framework
There are already plugins for most of the common testing frameworks:
- Jasmine
- Mocha
- and many others
- or yours
Installation
- Installation
npm install # if Karma and all the required plugins are already defined in package.json
npm install --save-dev karma
npm install --save-dev <required_karma_plugin> <another_required_karma_plugin>
- Configuration
#For macOS and Linux:
./node_modules/karma/bin/karma init
#For Windows:
npm install -g karma-cli
karma init
Conf
Tests are run according to a karma.conf.js configuration file which is generated in the interactive mode.