CARVIEW |
Select Language
HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Mon, 29 Jul 2024 17:43:22 GMT
access-control-allow-origin: *
etag: W/"66a7d4ba-2960"
expires: Sun, 12 Oct 2025 16:37:50 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: C25B:1602E2:15D52D:1A8EE9:68EBD700
accept-ranges: bytes
age: 0
date: Sun, 12 Oct 2025 16:27:50 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210028-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1760286470.876132,VS0,VE300
vary: Accept-Encoding
x-fastly-request-id: 5ade5f389f8ecc8bc08da23514e859896157b76a
content-length: 2788
Karma - Developing Plugins
Heads Up! You're viewing the docs for v0.10, an old version of Karma.
v6.4 is the newest.
Developing Plugins
Karma can be extended through plugins. A plugin is essentially an NPM module. Typically, there are four kinds of plugins: frameworks, reporters, launchers and preprocessors. The best way to understand how this works is to take a look at some of the existing plugins. Following sections list some of the plugins that you might use as a reference.
Frameworks #
- example plugins: karma-jasmine, karma-mocha, karma-requirejs
- use naming convention is
karma-*
- use NPM keywords
karma-plugin
,karma-framework
.
Reporters #
- example plugins: karma-growl-reporter, karma-junit-reporter
- use naming convention is
karma-*-reporter
- use NPM keywords
karma-plugin
,karma-reporter
Launchers #
- example plugins: karma-chrome-launcher, karma-sauce-launcher
- use naming convention is
karma-*-launcher
- use NPM keywords
karma-plugin
,karma-launcher
Preprocessors #
- example plugins: karma-coffee-preprocessor, karma-ng-html2js-preprocessor
- use naming convention is
karma-*-preprocessor
- user NPM keywords
karma-plugin
,karma-preprocessor
Crazier stuff #
Karma is assembled by Dependency Injection and a plugin is just an additional DI module (see node-di for more), that can be loaded by Karma. Therefore it can asks for pretty much any Karma component and interact with it. There are couple of plugins that do more interesting stuff like this, check out karma-closure, karma-intellij, karma-dart.