Home Manual Reference Source Test Repository
import TestDocFactory from 'esdoc/src/Factory/TestDocFactory.js'
public class | source

TestDocFactory

Test doc factory class.

Example:

let factory = new TestDocFactory('mocha', ast, pathResolver);
factory.push(node, parentNode);
let results = factory.results;

Static Member Summary

Static Private Members
private static

Static Method Summary

Static Private Methods
private static

get unique id.

Constructor Summary

Public Constructor
public

constructor(type: string, ast: AST, pathResolver: PathResolver)

create instance.

Member Summary

Public Members
public get
Private Members
private
private
private
private

Method Summary

Public Methods
public

push(node: ASTNode, parentNode: ASTNode)

push node, and factory process the node.

Private Methods
private

push node as mocha test code.

Static Private Members

private static _sequence: number source

Static Private Methods

private static _getUniqueId(): number source

get unique id.

Return:

number

unique id.

Public Constructors

public constructor(type: string, ast: AST, pathResolver: PathResolver) source

create instance.

Params:

NameTypeAttributeDescription
type string

test type. now support only 'mocha'.

ast AST

AST of test code.

pathResolver PathResolver

path resolver of test code.

Public Members

public get results: DocObject[] source

Private Members

private _ast: AST source

private _pathResolver: PathResolver source

private _results: DocObject[] source

private _type: string source

Public Methods

public push(node: ASTNode, parentNode: ASTNode) source

push node, and factory process the node.

Params:

NameTypeAttributeDescription
node ASTNode

target node.

parentNode ASTNode

parent node of target node.

Private Methods

private _pushForMocha(node: ASTNode) source

push node as mocha test code.

Params:

NameTypeAttributeDescription
node ASTNode

target node.

Test: