Configuration
Syntax
One Double Zero configuration can be specified through command line flags, and in a configuration file.
Command line arguments have higher priority than the configuration file.
Configuration file
One Double Zero configuration can be specified in a configuration file. This makes it easier to re-run odz with consistent settings, and also allows for specification of options that are otherwise only available in the JavaScript API.
One Double Zero searches for a configuration file named .odzrc.json or .odzrc.toml, in that order, starting from the current working directory and walking up the filesystem tree.
Configuration reference
append
A flag that controls whether the run command should append the coverage data to the coverage directory instead of overwriting its content.
Defaults to false.
-
The
appendflag can be enabled by passing either the-aor the--appendcommand line flag toodz.$ odz run -a $ odz run --append -
The
appendflag can be enabled by setting theappendproperty in the configuration file totrue.-
{ "append": true } -
append = true
-
branchesThreshold
A percentage that controls the branches threshold the check command should compare the branches coverage to.
Defaults to 100.
-
The
branchesThresholdvalue can be configured through either the-btor the--branches-thresholdcommand line flags.$ odz check -bt 80 $ odz check --branches-threshold=80 -
The
branchesThresholdvalue can be configured through thethresholds.branchesproperty in the configuration file.-
{ "thresholds": { "branches": 80 } } -
[thresholds] branches = 80
-
coverageDirectory
A string that controls the path of the directory where the run command writes the coverage data to, and where the check and report commands read the coverage data from.
-
The
coverageDirectoryvalue can be configured through either the-cdor the--coverage-directorycommand line flags.$ odz run -cd .coverage $ odz run --coverage-directory=.coverage -
The
coverageDirectoryvalue can be configured through thecoverageDirectoryproperty in the configuration file.-
{ "coverageDirectory": ".coverage" } -
coverageDirectory = ".coverage"
-
excludedSources
An array of glob patterns used by the check, report and run commands to resolve the files to exclude from the files to compute coverage for.
Defaults to [].
-
The
excludedSourcesvalue can be configured through either the-Sor the--excluded-sourcescommand line flags.$ odz report -S src/**/*.test.ts -S src/**/*.fixture.ts $ odz report --excluded-sources src/**/*.test.ts --excluded-sources src/**/*.fixture.ts -
The
excludedSourcesvalue can be configured through theexcludedSourcesproperty in the configuration file.-
{ "excludedSources": [ "src/**/*.test.ts", "src/**/*.fixture.ts" ] } -
excludedSources = [ "src/**/*.test.ts", "src/**/*.fixture.ts" ]
-
functionsThreshold
A percentage that controls the functions threshold the check command should compare the functions coverage to.
Defaults to 100.
-
The
functionsThresholdvalue can be configured through either the-ftor the--functions-thresholdcommand line flags.$ odz check -ft 80 $ odz check --functions-threshold=80 -
The
functionsThresholdvalue can be configured through thethresholds.functionsproperty in the configuration file.-
{ "thresholds": { "functions": 80 } } -
[thresholds] functions = 80
-
linesThreshold
A percentage that controls the lines threshold the check command should compare the lines coverage to.
Defaults to 100.
-
The
linesThresholdvalue can be configured through either the-ltor the--lines-thresholdcommand line flags.$ odz check -lt 80 $ odz check --lines-threshold=80 -
The
linesThresholdvalue can be configured through thethresholds.linesproperty in the configuration file.-
{ "thresholds": { "lines": 80 } } -
[thresholds] lines = 80
-
logLevel
A string that controls the level of information output by One Double Zero.
Accepts "info" and "debug".
Defaults to "info".
-
The
logLevelvalue can be configured through either the-llor the--log-levelcommand line flags.$ odz report -ll debug $ odz report --log-level=debug -
The
logLevelvalue can be configured through thelogLevelproperty in the configuration file.-
{ "logLevel": "debug" } -
logLevel = "debug"
-
perFile
A flag that controls whether the check command should compare the coverage to the thresholds per file, or globally.
Defaults to false.
-
The
perFileflag can be enabled by passing either the-pfor the--per-filecommand line flag toodz.$ odz check -pf $ odz check --per-file -
The
perFileflag can be enabled by setting theperFileproperty in the configuration file totrue.-
{ "perFile": true } -
perFile = true
-
reporters
An array of Istanbul reporter names that controls the reporters that should be executed by the report and run commands.
Defaults to ["text"].
-
The
reportersvalue can be configured through either the-ror the--reporterscommand line flags.$ odz report -r text -r html $ odz report --reporters=text --reporters=html -
The
reportersvalue can be configured through thereportersproperty in the configuration file.-
{ "reporters": [ "text", "html" ] } -
reporters = [ "text", "html" ]
-
reportsDirectory
A string that controls the path of the directory where the report and run commands output the reports to.
Defaults to ".odz_output".
-
The
reportsDirectoryvalue can be configured through either the-rdor the--reports-directorycommand line flags.$ odz run -rd .reports $ odz run --reports-directory=.reports -
The
reportsDirectoryvalue can be configured through thereportsDirectoryproperty in the configuration file.-
{ "reportsDirectory": ".reports" } -
reportsDirectory = ".reports"
-
reporterOptions
A key-value map that controls the reporter options that should be passed to the reporters by the report and run commands, where each key is the name of a reporter, and each value is a record of options to pass to the said reporter.
Defaults to {}.
The reporterOptions value can be configured through the reporterOptions property in the configuration file.
-
{ "reporterOptions": { "html": { "defaultSummarizer": "nested" } } } -
[reporterOptions.html] defaultSummarizer = "nested"
sources
An array of glob patterns used by the check, report and run commands to resolve the files to compute coverage for.
Defaults to ["**/*.{js,mjs,jsx,ts,mts,tsx}"].
-
The
sourcesvalue can be configured through either the-sor the--sourcescommand line flags.$ odz report -s src/main/**/*.ts -s src/cli/**/*.ts $ odz report --sources=src/main/**/*.ts --sources=src/cli/**/*.ts -
The
sourcesvalue can be configured through thesourcesproperty in the configuration file.-
{ "sources": [ "src/main/**/*.ts", "src/cli/**/*.ts" ] } -
sources = [ "src/main/**/*.ts", "src/cli/**/*.ts" ]
-
statementsThreshold
A percentage that controls the statements threshold the check command should compare the statements coverage to.
Defaults to 100.
-
The
statementsThresholdvalue can be configured through either the-stor the--statements-thresholdcommand line flags.$ odz check -st 80 $ odz check --statements-threshold=80 -
The
statementsThresholdvalue can be configured through thethresholds.statementsproperty in the configuration file.-
{ "thresholds": { "statements": 80 } } -
[thresholds] statements = 80
-