Options
All
  • Public
  • Public/Protected
  • All
Menu

Initialize a new Hook with the given title and callback fn

see

https://mochajs.org/api/Hook.html

Hierarchy

  • Hook

Index

Constructors

constructor

Properties

Optional allowUncaught

allowUncaught: undefined | false | true

async

async: boolean

body

body: string

Optional callback

callback: Done

Optional ctx

ctx: Context

Optional duration

duration: undefined | number

Optional file

file: undefined | string

fn

fn: Func | AsyncFunc | undefined

Optional originalTitle

originalTitle: undefined | string

Optional parent

parent: Suite

pending

pending: boolean

Optional state

state: "failed" | "passed"

sync

sync: boolean

timedOut

timedOut: boolean

Optional timer

timer: any

title

title: string

type

type: "hook"

Methods

clearTimeout

  • clearTimeout(): void

Protected currentRetry

  • currentRetry(): number
  • currentRetry(n: number): void

enableTimeouts

  • enableTimeouts(): boolean
  • enableTimeouts(enabled: boolean): this

error

  • error(): any
  • error(err: any): void

fullTitle

  • fullTitle(): string
  • Return the full title generated by recursively concatenating the parent's full title.

    Returns string

globals

  • globals(): string[]
  • globals(globals: ReadonlyArray<string>): void

inspect

  • inspect(): string

isFailed

  • isFailed(): boolean
  • Return true if this Runnable has failed.

    Returns boolean

isPassed

  • isPassed(): boolean
  • Return true if this Runnable has passed.

    Returns boolean

isPending

  • isPending(): boolean

resetTimeout

  • resetTimeout(): void

retries

  • retries(): number
  • retries(n: number): void

run

  • run(fn: Done): void

skip

  • skip(): never
  • Halt and mark as pending.

    Returns never

slow

  • slow(): number
  • slow(ms: string | number): this

timeout

  • timeout(): number
  • timeout(ms: string | number): this

titlePath

  • titlePath(): string[]
  • Return the title path generated by concatenating the parent's title path with the title.

    Returns string[]

Generated using TypeDoc