Validating a syntactically correct imposter creation statically is quite difficult.
This module validates dynamically by running test requests through each predicate and each stub
to see if it throws an error. A valid request is one that passes the dry run error-free.
- Source:
Methods
(async) validate(request, logger) → {Object}
Validates that the imposter creation is syntactically valid
Parameters:
Name | Type | Description |
---|---|---|
request |
Object | The request containing the imposter definition |
logger |
Object | The logger |
- Source:
Returns:
Promise resolving to an object containing isValid and an errors array
- Type
- Object
(inner) create(options) → {Object}
Creates the validator
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Configuration for the validator Properties
|
- Source:
Returns:
- Type
- Object