API Docs for: 0.0.1-12
Show:

Report Class

Defined in: lib/report/index.js:8
Module: istanbul

abstract report class for producing coverage reports.

Usage

 var Report = require('istanbul').Report,
     report = Report.create('html'),
     collector = new require('istanbul').Collector;

 collector.add(coverageObject);
report.writeReport(collector);

Constructor

Report

(
  • options
)
protected

Parameters:

  • options Object

    Optional. The options supported by a specific store implementation.

Item Index

Methods

Methods

create

(
  • type
  • opts
)
Report static

returns a report implementation of the specified type.

Parameters:

  • type String

    the type of report to create

  • opts Object

    Optional. Options specific to the report implementation

Returns:

Report: a new store of the specified type

register

(
  • constructor
)
static

registers a new report implementation.

Parameters:

  • constructor Function

    the constructor function for the report. This function must have a TYPE property of type String, that will be used in Report.create()

writeReport

(
  • collector
  • sync
)

writes the report for a set of coverage objects added to a collector.

Parameters:

  • collector Collector

    the collector for getting the set of files and coverage

  • sync Boolean

    true if reports must be written synchronously, false if they can be written using asynchronous means (e.g. stream.write)