karma
Spectacular Test Runner for JavaScript
Karma is a JavaScript test runner that launches real web browsers and runs your tests inside them, but it is now deprecated, the maintainers recommend migrating to Jest or Web Test Runner for all new projects.
Karma is a tool that runs JavaScript tests inside real web browsers. Rather than simulating a browser environment, it launches actual browsers on your machine, loads your test files into them, and reports back whether everything passed or failed. The idea is that if your tests pass in Chrome, Firefox, or Safari on a real browser engine, you can be more confident the code will work for actual users.
It works by starting a small local web server and generating an HTML page that loads your test code. Karma does not include its own testing language or assertion style. Instead, it connects to whichever testing framework you are already using, such as Jasmine, Mocha, or QUnit, through a plugin system. This means you keep your existing test syntax and just use Karma to handle the browser-launching part.
Karma was originally built by the Angular team to replace an older tool they found unreliable. It became widely used across the JavaScript community, especially within Angular projects. Over time it accumulated plugins for code coverage reports, module loaders, and many browser targets including mobile and tablet browsers.
However, the README is direct about an important change: Karma is now deprecated. The project is no longer accepting new features or general bug fixes. The web testing space has changed significantly in the decade-plus since Karma was created, and newer tools now cover the same ground. The Angular team is moving to Jest and Web Test Runner, and the README points anyone using Karma to those alternatives. Only critical security fixes will be applied until Angular CLI's Web Test Runner support reaches a stable release.
If you are already using Karma in an existing project, it will continue to work, but the maintainers recommend migrating away. New projects should start with one of the suggested alternatives instead.
Where it fits
- Run an existing Karma test suite in Chrome, Firefox, or Safari to verify JavaScript code works in real browser engines.
- Generate code coverage reports for a JavaScript project using Karma's coverage plugin.
- Migrate an existing Angular project from Karma to Jest or Web Test Runner following the Angular team's official guidance.
- Configure headless Chrome for a CI environment so that an inherited Karma test suite can run without a display.