- Source:
Properties:
| Name | Type | Description |
|---|---|---|
enabled |
Boolean | Is the specHelper server enabled |
Server |
Object | The instnace of the SpecHelper server |
A speical "mock" server which enables you to test actions and tasks in a simple way. Only availalbe in the TEST environment.
Extends
Classes
Methods
(async, static) getStaticFile(file) → {Promise.<Object>}
- Source:
Mock a specHelper connection requesting a file from the server.
Parameters:
| Name | Type | Description |
|---|---|---|
file |
string | The name & path of the file to request. |
Returns:
The body contents and metadata of the file requested. Conatins: mime, length, body, and more.
- Type
- Promise.<Object>
(async, static) runAction(actionName, input) → {Promise.<Object>}
- Source:
Run an action via the specHelper server.
Parameters:
| Name | Type | Description |
|---|---|---|
actionName |
string | The name of the action to run. |
input |
Object | You can provide either a pre-build connection |
Returns:
The response from the action.
- Type
- Promise.<Object>
(static) runFullTask(taskName, params) → {Promise.<Object>}
- Source:
- See:
Use the specHelper to run a task. Note: this will run a full Task worker, and will also include any middleware. This is slower than api.specHelper.runTask.
Parameters:
| Name | Type | Description |
|---|---|---|
taskName |
string | The name of the task. |
params |
Object | Params to pass to the task |
Returns:
The return value from the task.
- Type
- Promise.<Object>
(async, static) runTask(taskName, params) → {Promise.<Object>}
- Source:
- See:
Use the specHelper to run a task.
Note: this only runs the task's run() method, and no middleware. This is faster than api.specHelper.runFullTask.
Parameters:
| Name | Type | Description |
|---|---|---|
taskName |
string | The name of the task. |
params |
Object | Params to pass to the task |
Returns:
The return value from the task.
- Type
- Promise.<Object>