Home Manual Reference Source Test Repository
public class | source

Plugin

The require-coverage plugin

Test:

Static Member Summary

Static Public Members
public static get

The default options to use

Member Summary

Private Members
private

Path to the coverage.json file generated by ESDoc

private

The coverage percentage required

Method Summary

Public Methods
public

Checks the docs coverage against the limit specified in options

public

handleConfig(config: Object)

Handles configuration passed in esdoc.json

public

handleOptions(options: Object)

Handles options passed through the plugin key inside esdoc.json

Static Public Members

public static get DefaultOptions: Object source

The default options to use

Properties:

NameTypeAttributeDescription
required Number
  • default: 90

The coverage percentage required

Private Members

private _coverageFilePath: * source

Path to the coverage.json file generated by ESDoc

private _required: Number source

The coverage percentage required

Public Methods

public checkCoverage() source

Checks the docs coverage against the limit specified in options

Throw:

Error

Throws an error if coverage.json-file cannot be found

Error

Throws an error if coverage percentage is less than required

Test:

public handleConfig(config: Object) source

Handles configuration passed in esdoc.json

Params:

NameTypeAttributeDescription
config Object

The ESDoc configuration stored inside esdoc.json

config.destination String

Needed for plugin to work

Test:

public handleOptions(options: Object) source

Handles options passed through the plugin key inside esdoc.json

Params:

NameTypeAttributeDescription
options Object
  • optional

The options to use

options.required Number
  • optional
  • default: Plugin.DefaultOptions.required

The coverage percentage required

Test: