First, install Karma as described in the Karma's official documentation.
Make sure karma is on your path and working properly.
Then execute the following command to install the grails-karma plugin
grails install-plugin grails-karma.
grails-karma is ready to be executed right after its installation.
Just put your test files under the
test/js-functional/ directories and execute
You can also use
grails test-app karma:unit or
grails test-app karma:functional to execute tests form a specific phase.
During development, I recommend using karma directly form the command line since it will execute tests for you as you change your files.
The default karma configuration uses Jasmine as the testing framework and Angular to interact with the browser on functional tests.
You can change any settings in the
functional.conf.js files under
There are only a few items, followed by a
// can't touch this comment, which the plugin relies on and should be left alone.
Don't worry aobut setting
autoWatch. grails-karma will override this option so tests are executed only once during the Grails build.
About this project
This is just the first version of this plugin and we are couting on your feedback to make this plugin better! Don't hesitate to send us an e-mail, create an issue on GitHub or, even better, submit a pull request.