Options
All
  • Public
  • Public/Protected
  • All
Menu

Module email

Index

Functions

Functions

getMail

  • getMail(config: TaskConfig, since: Date, to: string, subjectContains: string | ((string: any) => boolean), wait_times?: number[]): Object
  • Retrieve and delete an email.

    example
    const email = makeRandomEmail(config, 'myTestCase');
    const start = new Date();
    await ... // register with email
    const welcomeMail = await getMail(config, start, email, 'Welcome');
    assert.strictEqual(welcomeMail.text.includes('Hello'));
    assert.strictEqual(welcomeMail.html.includes('<p>Hello'));
    

    Parameters

    • config: TaskConfig

      The pentf configuration object.

    • since: Date

      Earliest time the email can be sent. (To avoid finding the email of a prior test.)

    • to: string

      receiveer email address (config.email if you have just one email address, often the result of makeRandomEmail)

    • subjectContains: string | ((string: any) => boolean)

      Search string for the subject, or a callable to execute to match.

    • wait_times: number[] = ...

      How long to wait between checking email. By default, we wait about 3 minutes total.

    Returns Object

    Email object with html and text properties.

Generated using TypeDoc