Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Utils

Hierarchy

Index

Constructors

Protected constructor

  • Returns Utils

Methods

Static assert

  • assert(assertion: unknown, message?: string): assertsassertion
  • Parameters

    • assertion: unknown
    • Optional message: string

    Returns assertsassertion

Static inspect

  • Returns a string representation of value that is intended for debugging.

    remarks

    Proxy or promise details (returned value, status) are not supported.

    Parameters

    Returns string

Static wait

  • wait(timeout: number): Promise<void>
  • Parameters

    • timeout: number

    Returns Promise<void>

Static waitFor

  • waitFor(callback: () => boolean, timeout?: number): Promise<void>
  • Waits for the callback to return true, otherwise the promise will be rejected after timeout

    Parameters

    • callback: () => boolean

      If callback returns true it resolves promise.

        • (): boolean
        • Returns boolean

    • Optional timeout: number

      The maximum milliseconds to wait, otherwise promise will be rejected. Defaults to 2000.

    Returns Promise<void>