Constructor
new AndNode(expectedCall)
Creates a new Tree.AndNode
Parameters:
| Name | Type | Description |
|---|---|---|
expectedCall |
ExpectedCall | Initial expected call for this node. |
- Source:
Members
expectedCalls :Array.<ExpectedCall>
ExpectedCalls for this node.
Type:
- Array.<ExpectedCall>
- Source:
name
Gets the human readable name for this node.
- Source:
Methods
match(mock, args) → {ExpectedCall|undefined}
Determines the the Mock and args match any ExpectedCalls in this node.
Parameters:
| Name | Type | Description |
|---|---|---|
mock |
Mock | Mock that was called. |
args |
Array.<object> | Arguments for the call. |
- Source:
Returns:
The matching ExpectedCall if found; otherwise undefined.
- Type
- ExpectedCall | undefined
merge(node)
Merges this node and another Tree.AndNode or Tree.ExpectedCallNode
Parameters:
| Name | Type | Description |
|---|---|---|
node |
Tree.AndNode | Tree.ExpectedCallNode | Node to merge with this node. |
- Source:
onlyOptionalRemain() → {boolean}
Checks to see if only optional ExpectedCalls remain in this node.
- Source:
Returns:
True if all incomplete calls are optional; otherwise false.
- Type
- boolean
partialMatch(mock) → {boolean}
Determines the the Mock partially matches any ExpectedCalls in this node.
Parameters:
| Name | Type | Description |
|---|---|---|
mock |
Mock | Mock that was called. |
- Source:
Returns:
True if the mock partially matches; otherwise false.
- Type
- boolean