hTest API - v0.1.0
    Preparing search index...

    Class TestResult

    Represents the result of a test or group of tests.

    Hierarchy

    • default
      • TestResult
    Index

    Constructors

    • Parameters

      • test: any
      • Optionalparent: any
      • Optionaloptions: any = {}

        Options bag propagated from run(). See the OPTIONS schema in src/util/options.js.

      Returns TestResult

    Properties

    actual: any
    details: any[] = []
    error: any
    finished: Promise<any>
    mapped: { actual: any; expect: any }
    messages: { args: string[]; method: string }[]
    options: any
    parent: any
    pass: any
    skipped: boolean
    stats: {} = {}
    test: any
    tests: any
    timeTaken: number = 0
    timeTakenAsync: number
    STATS_AVAILABLE: string[] = ...

    Accessors

    Methods

    • Dispatches a synthetic event event to target and returns true if either event’s cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

      MDN Reference

      Parameters

      • event: any

      Returns boolean

    • Evaluate whether the test passed or failed

      Returns { details: string[]; pass: any }

    • Evaluate whether a thrown error is as expected

      Returns { details: string[]; pass: any }

    • Evaluate whether the test took too long (for tests with time constraints)

      Returns { details: string[]; pass: any }

    • Get a summary of console messages intercepted during the test run.

      Parameters

      • Optionalo: { format?: "rich" | "plain" } = {}

        Options

        • Optionalformat?: "rich" | "plain"

          Format to use for output. Defaults to “rich”.

      Returns string

    • Get a string representation of the test result

      Parameters

      • Optionalo: any

      Returns string

    • Get a summary of the current status of the test

      Parameters

      • Optionalo: { format?: "rich" | "plain" } = {}

        Options

        • Optionalformat?: "rich" | "plain"

          Format to use for output. Defaults to “rich”

      Returns string

    • Returns a string representation of an object.

      Parameters

      • o: any

      Returns any[]