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.
There are already plugins for most of the common testing frameworks:
- and many others
- or yours
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>
#For macOS and Linux: ./node_modules/karma/bin/karma init #For Windows: npm install -g karma-cli karma init
Tests are run according to a karma.conf.js configuration file which is generated in the interactive mode.