Skip to content

Portlet Testing

anja edited this page Jan 12, 2017 · 2 revisions

For testing we use the following nodejs modules: chai, karma, mocha and sinon. The test are run via grunt.

Write Unit tests

The unit test are located in src/test/webapp/mocha. See existing tests as example.

Execute Unittest

in a console execute one of the grunt jops with

grunt [jop name]

If no jop name is provided, the default jop is executed.

jop name description

unitTest

test source files with jshint

+ execute unit test in firefox and chrome

+ build test & coverage report

Please Note: if a jshint is found the unit test are not executed

unitTestChrome

test source files with jshint

+ execute unit test in chrome

+ build test & coverage report

Please Note: if a jshint is found the unit test are not executed

unitTestFirefox

test source files with jshint

+ execute unit test in firefox

+ build test & coverage report

Please Note: if a jshint is found the unit test are not executed

default

like unitTest, but the unit test are executed even if a jshint is detected

+