Class CronTester

A utility class for testing scheduled cronjobs using @Cron(...) annotation.

Hierarchy

  • CronTester

Constructors

Properties

Methods

Constructors

Properties

initialized: boolean = false
jobs: {
    crontab: string;
    func: Function;
}[] = []

Type declaration

  • crontab: string
  • func: Function

Methods

  • Tests if a cron job with the specified crontab exists and executes the associated function.

    Parameters

    • crontab: string

      The crontab schedule string.

    Returns Promise<any>

    A promise that resolves with the value returned by the executed function.

    Throws

    If the CronTester has not been initialized.

Generated using TypeDoc