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-2863"
expires: Sat, 11 Oct 2025 01:53:28 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: 5B44:3FE33C:1E33E:2A23F:68E9B63F
accept-ranges: bytes
age: 0
date: Sat, 11 Oct 2025 01:43:28 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210038-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1760147008.040109,VS0,VE316
vary: Accept-Encoding
x-fastly-request-id: 76fdc7fad93f8f6036f7db78d502315c8adb0dc6
content-length: 2876
Karma - Plugins
Heads Up! You're viewing the docs for v5.0, an old version of Karma.
v6.4 is the newest.
Plugins
Karma can be easily extended through plugins. In fact, all the existing preprocessors, reporters, browser launchers and frameworks are also plugins.
Installation #
Karma plugins are NPM modules, so the recommended way to install them are as project dependencies in your package.json
:
{
"devDependencies": {
"karma": "~0.10",
"karma-mocha": "~0.0.1",
"karma-growl-reporter": "~0.0.1",
"karma-firefox-launcher": "~0.0.1"
}
}
Therefore, a simple way to install a plugin is:
npm install karma-<plugin name> --save-dev
Loading Plugins #
By default, Karma loads all sibling NPM modules which have a name starting with karma-*
.
You can also explicitly list plugins you want to load via the plugins
configuration setting. The configuration value can either be
a string (module name), which will be required by Karma, or an object (inlined plugin).
plugins: [
// Karma will require() these plugins
'karma-jasmine',
'karma-chrome-launcher'
// inlined plugins
{'framework:xyz': ['factory', factoryFn]},
require('./plugin-required-from-config')
]
There are already many existing plugins. Of course, you can write your own plugins too!