Command line usage

Once installed, a command-line script called odz is placed on your path.

By default, odz runs the command passed as last argument, collecting coverage data along the way, and executes the configured reporters.

It also supports the following commands:

  • check - Check that the coverage of the configured source files is at least greater than or equal to the configured thresholds, and exit with an error if this is not the case.
  • report - Report the coverage of the configured source files, using the configured reporters.
  • run - Run the passed command, and collects coverage data along the way.
  • version - Output the version of One Double Zero to the terminal.

Help is available by passing the --help flag to odz, or any of its commands:

$ odz --help
$ odz run --help

Commands

check

odz check [options]

Check that the coverage of the configured source files is at least greater than or equal to the configured thresholds, and exit with an error if this is not the case.

The check command also outputs to the terminal the reasons why it failed.

In addition to the -h, --help flag, the check command accepts the following flags:

-bt, --branches-threshold <BRANCHES_THRESHOLD>

Controls the value of the branchesThreshold option.

-cd, --coverage-directory <COVERAGE_DIRECTORY>

Controls the value of the coverageDirectory option.

-ft, --functions-threshold <FUNCTIONS_THRESHOLD>

Controls the value of the functionsThreshold option.

-lt, --lines-threshold <LINES_THRESHOLD>

Controls the value of the linesThreshold option.

-ll, --log-level

Controls the value of the logLevel option.

-pf, --per-file

Controls the value of the perFile option.

-s, --sources <SOURCES...>

Controls the value of the sources option.

-st, --statements-threshold <STATEMENTS_THRESHOLD>

Controls the value of the statementsThreshold option.

report

odz report [options]

Report the coverage of the configured source files, using the configured reporters.

The report command expects some coverage data to be present in the configured coverage directory.

The report command only supports Istanbul reporters. Please use the JavaScript API to execute custom reporters.

In addition to the -h, --help flag, the report command accepts the following flags:

-cd, --coverage-directory <COVERAGE_DIRECTORY>

Controls the value of the coverageDirectory option.

-ll, --log-level

Controls the value of the logLevel option.

-r, --reporters <REPORTERS...>

Controls the value of the reporters option.

-rd, --reports-directory <REPORTS_DIRECTORY>

Controls the value of the reportsDirectory option.

-s, --sources <SOURCES...>

Controls the value of the sources option.

run

odz run [options] <command>

Run the passed command, and collects coverage data along the way.

The run command is technically agnostic of the passed command (i.e. it is perfectly possible to pass ls -la as command), but, logically, it expects the passed command to collect coverage data when the NODE_V8_COVERAGE environment variable is set.

Said differently, in its current form, it is opinionated towards a Node.js script, and no other way to trigger the collection of coverage data is supported by the run command.

In addition to the -h, --help flag, the run command accepts the following flags:

-a, --append

Controls the value of the append option.

-cd, --coverage-directory <COVERAGE_DIRECTORY>

Controls the value of the coverageDirectory option.

-ll, --log-level

Controls the value of the logLevel option.

version

Output the version of One Double Zero to the terminal.

The version command only supports the -h, --help flag.