The list below is a collection of common questions regarding Karma and its use. If you have any other questions in mind, please visit the mailing list to let the community know.
Yes. There are plugins for most of the common testing frameworks (such as Jasmine, Mocha, QUnit). If there is no plugin for the testing framework you like, go ahead and write one. It is simple - you can start by looking into the source code of the existing ones.
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.
Of course! Check out the docs for Jenkins, Travis or Semaphore.
The latest stable version from NPM (npm install karma
). See versioning for more detailed information about Karma's release channels.
The two latest stable versions. That means 0.8
and 0.10
at this point.
It's more likely Karma can't find the location of the browser binary (the execution file). You can fix this by setting
the appropriate environment variable with the correct path (Google Chrome for instance uses the CHROME_BIN
environment variable).
Check out browsers for more information.
Go to the captured browser and click the "DEBUG" button (or open http://localhost:9876/debug.html
)
and use the web inspector to see what's going on. (You may need to refresh the debug.html page for it to kick in once
the web inspector is open.)
The patterns in the preprocessors
configuration setting are resolved via the basePath
setting.
See preprocessors for more information. You can also turn on debug logging (use --log-level debug
when starting Karma)
and Karma will display which files are preprocessed.
npm ERR! peerinvalid Peer
error. How can I fix that ? #Try to remove karma
and karma-*
modules from your node_modules
first (for instance rm -rf /usr/local/lib/node_modules/karma-*
), than install Karma again.
Make sure the Karma's tab is active. Browsers give inactive tabs only minimum CPU.