Maintains all stubs for an imposter
- Source:
Members
(constant) stubs :Array
The list of stubs within this repository
Type:
- Array
- Source:
Methods
addStub(stub, beforeResponse)
Adds a stub to the repository
Parameters:
Name | Type | Description |
---|---|---|
stub |
Object | The stub to add |
beforeResponse |
Object | If provided, the new stub will be added before the stub containing the response (used for proxyOnce) |
- Source:
getResponseFor(request, logger, imposterState) → {Object}
Finds the next response configuration for the given request
Parameters:
Name | Type | Description |
---|---|---|
request |
Object | The protocol request |
logger |
Object | The logger |
imposterState |
Object | The current state for the imposter |
- Source:
Returns:
- Promise resolving to the response
- Type
- Object
getStubs() → {Object}
Returns the outside representation of the stubs
- Source:
Returns:
- The stubs
- Type
- Object
(inner) create(encoding) → {Object}
Creates the repository
Parameters:
Name | Type | Description |
---|---|---|
encoding |
string | utf8 or base64 |
- Source:
Returns:
- Type
- Object