Options
All
  • Public
  • Public/Protected
  • All
Menu

Module specHelper

Index

Functions

buildConnection

  • buildConnection(): Promise<any>

findEnqueuedTasks

  • findEnqueuedTasks(taskName: string): Promise<any[]>
  • Use the specHelper to find enqueued instances of a task This will return an array of intances of the task which have been enqueued either in the normal queues or delayed queues If a task is enqued in a delayed queue, it will have a 'timestamp' propery i.e. [ { class: 'regularTask', queue: 'testQueue', args: [ [Object] ] } ]

    Parameters

    • taskName: string

    Returns Promise<any[]>

getStaticFile

  • getStaticFile(file: string): Promise<any>
  • Mock a specHelper connection requesting a file from the server.

    Parameters

    • file: string

    Returns Promise<any>

runAction

  • runAction(actionName: string, input?: object): Promise<object>
  • Run an action via the specHelper server.

    Parameters

    • actionName: string
    • Default value input: object = {}
      • [key: string]: any

    Returns Promise<object>

runFullTask

  • runFullTask(taskName: string, params: object | Array<any>): Promise<any>
  • 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

    • taskName: string
    • params: object | Array<any>

    Returns Promise<any>

runTask

  • runTask(taskName: string, params: object | Array<any>): Promise<object>
  • 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

    • taskName: string
    • params: object | Array<any>

    Returns Promise<object>

Generated using TypeDoc