Home Manual Reference Source Test
import ESDocCoverage from '@ls-age/esdoc-coverage/src/index.js'
public class | source

ESDocCoverage

The main esdoc-coverage class.

Test:

Static Member Summary

Static Public Members
public static get

The currently used package version.

Static Method Summary

Static Public Methods
public static

Creates a new ESDocCoverage instance with the given command line arguments.

Constructor Summary

Public Constructor
public

constructor(options: Object, command: string)

Creates a new ESDocCoverage instance based on some options and the command to run.

Member Summary

Public Members
public

The options the current instance was created with.

Private Members
private

The command to run.

Method Summary

Public Methods
public

Checks the documentation coverage.

public

run(command: Command): Promise<Error>

Runs the specified command

Private Methods
private

Validates the documentation coverage reported in the given report matches the threshold specified.

private

Gets the documentation coverage report for the given config.

private

Searches the given paths for valid ESDoc configurations.

Static Public Members

public static get version: string source

The currently used package version.

Test:

Static Public Methods

public static withArgs(args: string[]): ESDocCoverage source

Creates a new ESDocCoverage instance with the given command line arguments.

Params:

NameTypeAttributeDescription
args string[]

The command line arguments to use.

Return:

ESDocCoverage

The new ESDocCoverage instance.

Test:

Public Constructors

public constructor(options: Object, command: string) source

Creates a new ESDocCoverage instance based on some options and the command to run.

Params:

NameTypeAttributeDescription
options Object
  • optional
  • default: {}

The options to use.

options.reporter string
  • optional
  • default: 'cli'

The reporter to use.

options.config string
  • optional

The esdoc config path.

command string
  • optional

The command to run. Note that you have to call ESDocCoverage#run to run the command specified.

Test:

Public Members

public options: Object source

The options the current instance was created with.

Private Members

private _command: string source

The command to run.

Public Methods

public checkCoverage(): Promise<Error> source

Checks the documentation coverage.

Return:

Promise<Error>

Rejected if any errors occur.

Test:

public run(command: Command): Promise<Error> source

Runs the specified command

Params:

NameTypeAttributeDescription
command Command
  • optional

The command to run. If not provided it is assumed, that a command was passed to the constructor.

Return:

Promise<Error>

A promise that is rejected if the command fails.

Test:

Private Methods

private _checkCoverageReport(report: Object): * source

Validates the documentation coverage reported in the given report matches the threshold specified.

Params:

NameTypeAttributeDescription
report Object

The report to handle.

Return:

*

Test:

private _getCoverageReport(config: Object): Promise<Error, Object> source

Gets the documentation coverage report for the given config.

Params:

NameTypeAttributeDescription
config Object

An ESDoc configuration.

Return:

Promise<Error, Object>

Fulfilled with the coverage report found or rejected with the error that occured.

Test:

private _getESDocConfig(paths: string[]): Promise<Error, Object> source

Searches the given paths for valid ESDoc configurations.

Params:

NameTypeAttributeDescription
paths string[]

The paths to search.

Return:

Promise<Error, Object>

Fulfilled with the ESDoc config found or rejected with the error that occured.

Test: