Test on Real Devices - Test your code on real browsers and real devices such as phones, tablets or on a headless PhantomJS instance.
Remote Control - Control the whole workflow from the command line or your IDE - just save a file and Karma will run all the tests.
Testing Framework Agnostic - Describe your tests with Jasmine, Mocha, QUnit, or write a simple adapter for any framework you like.
Easy Debugging - directly from your IDE via WebStorm or Google Chrome.
Continuous Integration - Simple integration with Jenkins, Travis or Semaphore.
Can be integrated in to your IDE. Nearly all IDEs have a way to add an external tool that is launched on the command line.
Karma spawns a web server that executes source code against test code for each of the browsers connected.
The results for each test against each browser are examined and displayed via the command line to the developer such that they can see which browsers and tests passed or failed.
A browser can be captured either
- manually, by visiting the URL where the Karma server is listening (typically http://localhost:9876/),
- or automatically by letting Karma know which browsers to start when Karma is run
Karma launches a HTTP server, and generates the test runner HTML file.
Execute your tests locally during development.
Execute your tests on a continuous integration server.Jenkins, Travis or Semaphore.
Execute your tests on every save.
Use Istanbul to automatically generate coverage reports.
Use RequireJS for your source files.
Karma has primarily been designed for low level (unit) testing. If it's an AngularJS app, you can use Karma with karma-ng-scenario plugin, however we recommend Protractor for high level testing.
Karma can be easily extended through plugins. In fact, all the existing preprocessors, reporters, browser launchers and frameworks are also plugins
Comments
Karma is not suitable for E2E
Karma is a test runner that
Karma is a test runner that will run the JavaScript files specified in you configuration file explicitly or using node-globs. (For non-JavaScript external templates, Angular's Unit Testing Guide recommends using Karma html preprocessor to compile them into JavaScript first.)
These can be all your source files, some of them, some of them plus some additional files or files irrelevant to your project, only providing some extra configuration - you name it! You can have multiple karma config files for different purposes, which you can run in parallel or one-by-one. Each karma process launches its own set of browsers (these are currently available).
This feature of Karma to run only a set of files is what makes it perfect for fast tests running in background upon each source file edit, and get immediate feedback, which is brilliant! The only negative is the "noisy" error reporting that will hopefully improve!