Skip to content

self-assert / CollectableRule

Interface: CollectableRule<ValueType, CollectionType> ​

Describes a rule that knows how to collect failures into a list.

Extends ​

Type Parameters ​

Type Parameter
ValueType
CollectionType extends void | Promise<void>

Labeling ​

isLabeledAs() ​

isLabeledAs(aBrokenRuleLabel): boolean

Checks if the assertion has the same id and description as the given one.

Parameters ​

ParameterType
aBrokenRuleLabelLabeledRule

Returns ​

boolean

Inherited from ​

LabeledRule.isLabeledAs


hasLabelId() ​

hasLabelId(anId): boolean

Compares the id of the assertion with the given one.

Parameters ​

ParameterType
anIdstring

Returns ​

boolean

Inherited from ​

LabeledRule.hasLabelId


hasLabel() ​

hasLabel(anId, aDescription): boolean

Compare the id and description of the assertion with the given ones.

Parameters ​

ParameterType
anIdstring
aDescriptionstring

Returns ​

boolean

Inherited from ​

LabeledRule.hasLabel


hasDescription() ​

hasDescription(aDescription): boolean

Checks if the assertion has the given description.

Parameters ​

ParameterType
aDescriptionstring

Returns ​

boolean

Remarks ​

This method is used mostly for testing.

Inherited from ​

LabeledRule.hasDescription


getId() ​

getId(): string

Returns the label identifier.

Returns ​

string

Inherited from ​

LabeledRule.getId


getDescription() ​

getDescription(): string

Returns ​

string

Inherited from ​

LabeledRule.getDescription

Others ​

collectFailureInto() ​

collectFailureInto(failed, value): CollectionType

Parameters ​

ParameterType
failedLabeledRule[]
valueValueType

Returns ​

CollectionType