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 append flag can be enabled by passing either the -a or the --append command line flag to odz.

    $ odz run -a
    $ odz run --append
    
  • The append flag can be enabled by setting the append property in the configuration file to true.

    • {
        "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 branchesThreshold value can be configured through either the -bt or the --branches-threshold command line flags.

    $ odz check -bt 80
    $ odz check --branches-threshold=80
    
  • The branchesThreshold value can be configured through the thresholds.branches property 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 coverageDirectory value can be configured through either the -cd or the --coverage-directory command line flags.

    $ odz run -cd .coverage
    $ odz run --coverage-directory=.coverage
    
  • The coverageDirectory value can be configured through the coverageDirectory property in the configuration file.

    • {
        "coverageDirectory": ".coverage"
      }
      
    • coverageDirectory = ".coverage"
      

functionsThreshold

A percentage that controls the functions threshold the check command should compare the functions coverage to.

Defaults to 100.

  • The functionsThreshold value can be configured through either the -ft or the --functions-threshold command line flags.

    $ odz check -ft 80
    $ odz check --functions-threshold=80
    
  • The functionsThreshold value can be configured through the thresholds.functions property 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 linesThreshold value can be configured through either the -lt or the --lines-threshold command line flags.

    $ odz check -lt 80
    $ odz check --lines-threshold=80
    
  • The linesThreshold value can be configured through the thresholds.lines property 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 logLevel value can be configured through either the -ll or the --log-level command line flags.

    $ odz report -ll debug
    $ odz report --log-level=debug
    
  • The logLevel value can be configured through the logLevel property 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 perFile flag can be enabled by passing either the -pf or the --per-file command line flag to odz.

    $ odz check -pf
    $ odz check --per-file
    
  • The perFile flag can be enabled by setting the perFile property in the configuration file to true.

    • {
        "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 reporters value can be configured through either the -r or the --reporters command line flags.

    $ odz report -r text -r html
    $ odz report --reporters=text --reporters=html
    
  • The reporters value can be configured through the reporters property 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 reportsDirectory value can be configured through either the -rd or the --reports-directory command line flags.

    $ odz run -rd .reports
    $ odz run --reports-directory=.reports
    
  • The reportsDirectory value can be configured through the reportsDirectory property in the configuration file.

    • {
        "reportsDirectory": ".reports"
      }
      
    • reportsDirectory = ".reports"
      

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 sources value can be configured through either the -s or the --sources command line flags.

    $ odz report -s src/main/**/*.ts -s src/cli/**/*.ts
    $ odz report --sources=src/main/**/*.ts --sources=src/cli/**/*.ts
    
  • The sources value can be configured through the sources property 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 statementsThreshold value can be configured through either the -st or the --statements-threshold command line flags.

    $ odz check -st 80
    $ odz check --statements-threshold=80
    
  • The statementsThreshold value can be configured through the thresholds.statements property in the configuration file.

    • {
        "thresholds": {
          "statements": 80
        }
      }
      
    • [thresholds]
      statements = 80