Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace specHelper

Index

Functions

buildConnection

  • buildConnection(): Promise<any>

deleteEnqueuedTasks

  • deleteEnqueuedTasks(taskName: string, params: {}): Promise<void>
  • Delete all enqueued instances of a task, both in all the normal queues and all of the delayed queues

    Parameters

    • taskName: string
    • params: {}

    Returns Promise<void>

findEnqueuedTasks

  • findEnqueuedTasks(taskName: string): Promise<any[]>
  • Use the specHelper to find enqueued instances of a task This will return an array of instances of the task which have been enqueued either in the normal queues or delayed queues If a task is enqueued in a delayed queue, it will have a 'timestamp' property 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<ActionRunMethod>(actionName: string, input?: {}): Promise<ActionRunMethod extends (data: {}) => Promise<ActionResponse> ? UnwrapPromise<ActionRunMethod> : any & { error: string }>
  • Run an action via the specHelper server.

    Type parameters

    • ActionRunMethod

    Parameters

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

    Returns Promise<ActionRunMethod extends (data: {}) => Promise<ActionResponse> ? UnwrapPromise<ActionRunMethod> : any & { error: string }>

runFullTask

  • runFullTask<TaskRunMethod>(taskName: string, params: object | any[]): Promise<TaskRunMethod extends (data: TaskInputs, worker: any) => Promise<any> ? UnwrapPromise<TaskRunMethod> : any & { error: string }>
  • 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.

    Type parameters

    • TaskRunMethod

    Parameters

    • taskName: string
    • params: object | any[]

    Returns Promise<TaskRunMethod extends (data: TaskInputs, worker: any) => Promise<any> ? UnwrapPromise<TaskRunMethod> : any & { error: string }>

runTask

  • runTask<TaskRunMethod>(taskName: string, params: object | any[]): Promise<TaskRunMethod extends (data: TaskInputs, worker: any) => Promise<any> ? UnwrapPromise<TaskRunMethod> : any & { error: string }>
  • 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.

    Type parameters

    • TaskRunMethod

    Parameters

    • taskName: string
    • params: object | any[]

    Returns Promise<TaskRunMethod extends (data: TaskInputs, worker: any) => Promise<any> ? UnwrapPromise<TaskRunMethod> : any & { error: string }>

Generated using TypeDoc