• page

Maven funcunit.maven


Maven is a build tool, usually used for Java projects. FuncUnit can be run from maven as part of the build, using the maven antrun plugin.

            <echo>Running funcunit tests</echo>
            <exec dir="src/main/webapp/ui" executable="src/main/webapp/ui/js"
              <arg value="-e" />
              <arg value="funcunit/run" />
              <arg value="phantomjs" />
              <arg value="funcunit.html" />

Failing on errors

To force maven to fail the build on errors, FuncUnit has to exit "hard" with exit code 1 if there's a failure. Run the js script with the "-e" flag as shown above. This tells the batch script to exit hard if something throws an error. If this property is set, xunit will exit with exit code 1 if there are failed tests.