Module: models/stubRepository

Maintains all stubs for an imposter

Source:

Members

(constant) stubs :Array

The list of stubs within this repository

Type:
  • Array
Source:

Methods

addStub(stub)

Adds a stub to the repository

Parameters:
Name Type Description
stub Object

The stub to add

Source:

getStubs() → {Object}

Returns the outside representation of the stubs

Source:
Returns:
  • The stubs
Type
Object

resolve(request, logger, imposterState) → {Object}

Finds the right stub for a request and generates a response

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

(inner) create(resolver, recordMatches, encoding) → {Object}

Creates the repository

Parameters:
Name Type Description
resolver module:models/responseResolver

The response resolver

recordMatches boolean

Whether to record matches (the --debug command line flag)

encoding string

utf8 or base64

Source:
Returns:
Type
Object