Fork me on GitHub

Introduction

This plugin provides the capacity to run attester as part of a maven build.

This allows to easily run Javascript unit tests during a maven build (just like Java unit tests), with the following features:

  • Code coverage
  • Fully headless tests with PhantomJS
  • Integration with Sonar
  • Tests can be run in parallel

You can check the features of attester for more information.

Even if attester depends on node.js and is able to use PhantomJS, this maven plugin does not require those programs to be pre-installed on the build machine, they simply have to be available in the maven repository and they will be downloaded as maven artifacts.

Note: this maven plugin currently only references the Windows version of the node.js and PhantomJS artifacts. Moreover, it was only tested on Windows. However, support for other environments may be added in the future, as attester is platform-independent, and both node.js and PhantomJS are compatible with several platforms.

Goals overview

Here are the main goals provided by this maven plugin:

  • attester:test : Runs Javascript tests in a fully automated way and writes result and coverage reports.
  • attester:run : Starts an internal web server with the same configuration as the attester:test goal but waits until it is manually stopped. This allows to run tests manually in any browser, and to debug failing tests.

Additionally, the following more general goals are available, because their functionality was needed to implement the main goals:

  • attester:node : Runs any node.js program. An error is raised if the exit code is different from 0.
  • attester:extract-dependencies : Extracts zip artifacts in a temporary directory named according to the artifact. If an artifact is already extracted, it is not extracted again.

Usage

General instructions on how to use this plugin can be found on the usage page.

To report issues, bugs and ask for new features, please open an issue in GitHub.