See the Karma documentation for more info.
Karma runs the tests in the browser, but reports them in the CLI. This greatly improves your workflow by giving you constant, accurate feedback on the status of your tests.
PhantomJS is a great option too, but it has the one drawback that it won't expose browser inconsistencies.
Install it globally npm install -g generator-karma
.
Running yo karma
will generate two files for your project: karma.conf.js
and karma-e2e.conf.js
. It will then install the npm dependencies.
Note that you'll need to update your Gruntfile.js
. If you're using Karma through the AngularJS generator, all of the configuration is done for you.
-
--skip-install
Skips the automatic execution of
bower
andnpm
after scaffolding has finished. -
--test-framework=[framework]
Defaults to
mocha
. Can be switched for another supported testing framework likejasmine
orqunit
. -
--coffee
Enable support for tests written in CoffeeScript.
-
--travis
Enable Travis CI config generation.
Karma can be configured by editing karma.conf.js
. See the documentation page on the config file for an exhaustive list of options.
See the contributing docs