Testing

Testing harness utilities.
Source:

Classes

MockConversation

Methods

(static) MockCompositeBagEntityVariable(entityNameopt, itemsopt)

Source:
Create a composite bag entity variable to include in mock request
Parameters:
Name Type Attributes Description
entityName string <optional>
name of the composite bag entity
items array <optional>
list of composite bag items, you can use function MockCompositeBagItem to create each item

(static) MockCompositeBagItem(nameopt, typeopt, entityNameopt)

Source:
Create a composite bag item to include in composite bag entity variable
Parameters:
Name Type Attributes Description
name string <optional>
name of the composite bag item
type string <optional>
type of the composite bag item (ENTITY, STRING, LOCATION or ATTACHMENT)
entityName string <optional>
name of the composite bag entity if type is set to ENTITY

(static) MockEventHandlerRequest(variableNameopt, currentItemopt, userMessageopt, userMessageopt, eventsopt, variablesopt)

Source:
Create a mock request for entity event handler middleware handling.
Parameters:
Name Type Attributes Description
variableName string <optional>
name of composite bag variable to resolve
currentItem string <optional>
name of current bag item to resolve
userMessage string <optional>
last user message
userMessage string <optional>
candidate message that will be shown to user if event handler does not change it
events array <optional>
list of events to process by event handler. Each event can be created with function MockResolveEntitiesEvent
variables object <optional>
context variables, the composite bag variable that must be resolved can be created using function MockCompositeBagEntityVariable

(static) MockRequest(messagePayloadopt, propertiesopt, variablesopt, typeopt)

Source:
Create a mock request for component middleware handling. Individual properties and variables may be specified by modifying the result.
Parameters:
Name Type Attributes Description
messagePayload * <optional>
message payload
properties * <optional>
conversation properties
variables * <optional>
conversation variables
type string <optional>
channel type

(static) MockResolveEntitiesEvent(nameopt, isCustomopt, propertiesopt, eventItemopt)

Source:
Create a Resolve Entities event to include in mock request
Parameters:
Name Type Attributes Description
name string <optional>
event name
isCustom string <optional>
boolean indicating whether this is custom event (defaults to false)
properties object <optional>
event properties, optional
eventItem string <optional>
item name (optional, only required for item-level event)