Initialize a new `Hook` with the given `title` and callback `fn`

see

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

### Hierarchy

- Hook

## Index

### Constructors

- constructor

### Properties

- allowUncaught
- async
- body
- callback
- ctx
- duration
- file
- fn
- originalTitle
- parent
- pending
- state
- sync
- timedOut
- timer
- title
- type

### Methods

- clearTimeout
- currentRetry
- enableTimeouts
- error
- fullTitle
- globals
- inspect
- isFailed
- isPassed
- isPending
- resetTimeout
- retries
- run
- skip
- slow
- timeout
- titlePath

## Constructors

### constructor

- new Hook(title: string, fn?: Func | AsyncFunc): Hook

- Inherited from Runnable.constructor

  - Defined in node_modules/@types/mocha/index.d.ts:1091

  #### Parameters

  - ##### title: string

  - ##### Optional fn: Func | AsyncFunc

  #### Returns Hook

## Properties

### Optional allowUncaught

allowUncaught: undefined | false | true

Inherited from Runnable.allowUncaught

- Defined in node_modules/@types/mocha/index.d.ts:1108

### async

async: boolean

Inherited from Runnable.async

- Defined in node_modules/@types/mocha/index.d.ts:1098

### body

body: string

Inherited from Runnable.body

- Defined in node_modules/@types/mocha/index.d.ts:1097

### Optional callback

callback: Done

Inherited from Runnable.callback

- Defined in node_modules/@types/mocha/index.d.ts:1107

### Optional ctx

ctx: Context

Inherited from Runnable.ctx

- Defined in node_modules/@types/mocha/index.d.ts:1106

### Optional duration

duration: undefined | number

Inherited from Runnable.duration

- Defined in node_modules/@types/mocha/index.d.ts:1102

### Optional file

file: undefined | string

Inherited from Runnable.file

- Defined in node_modules/@types/mocha/index.d.ts:1109

### fn

fn: Func | AsyncFunc | undefined

Inherited from Runnable.fn

- Defined in node_modules/@types/mocha/index.d.ts:1096

### Optional originalTitle

originalTitle: undefined | string

- Defined in node_modules/@types/mocha/index.d.ts:2118

### Optional parent

parent: Suite

Inherited from Runnable.parent

- Defined in node_modules/@types/mocha/index.d.ts:1103

### pending

pending: boolean

Inherited from Runnable.pending

- Defined in node_modules/@types/mocha/index.d.ts:1101

### Optional state

state: "failed" | "passed"

Inherited from Runnable.state

- Defined in node_modules/@types/mocha/index.d.ts:1104

### sync

sync: boolean

Inherited from Runnable.sync

- Defined in node_modules/@types/mocha/index.d.ts:1099

### timedOut

timedOut: boolean

Inherited from Runnable.timedOut

- Defined in node_modules/@types/mocha/index.d.ts:1100

### Optional timer

timer: any

Inherited from Runnable.timer

- Defined in node_modules/@types/mocha/index.d.ts:1105

### title

title: string

Inherited from Runnable.title

- Defined in node_modules/@types/mocha/index.d.ts:1095

### type

type: "hook"

- Defined in node_modules/@types/mocha/index.d.ts:2117

## Methods

### clearTimeout

- clearTimeout(): void

- Inherited from Runnable.clearTimeout

  - Defined in node_modules/@types/mocha/index.d.ts:1218

  Clear the timeout.

  see

    https://mochajs.org/api/Runnable.html#clearTimeout

  #### Returns void

### Protected currentRetry

- currentRetry(): number
- currentRetry(n: number): void

- Inherited from Runnable.currentRetry

  - Defined in node_modules/@types/mocha/index.d.ts:1194

  Set or get current retry

  see

    https://mochajs.org/api/Runnable.html#currentRetry

  #### Returns number

- Inherited from Runnable.currentRetry

  - Defined in node_modules/@types/mocha/index.d.ts:1201

  Set or get current retry

  see

    https://mochajs.org/api/Runnable.html#currentRetry

  #### Parameters

  - ##### n: number

  #### Returns void

### enableTimeouts

- enableTimeouts(): boolean
- enableTimeouts(enabled: boolean): this

- Inherited from Runnable.enableTimeouts

  - Defined in node_modules/@types/mocha/index.d.ts:1144

  Get whether timeouts are enabled.

  see

    https://mochajs.org/api/Runnable.html#enableTimeouts

  #### Returns boolean

- Inherited from Runnable.enableTimeouts

  - Defined in node_modules/@types/mocha/index.d.ts:1151

  Set whether timeouts are enabled.

  see

    https://mochajs.org/api/Runnable.html#enableTimeouts

  #### Parameters

  - ##### enabled: boolean

  #### Returns this

### error

- error(): any
- error(err: any): void

- - Defined in node_modules/@types/mocha/index.d.ts:2125

  Get the test `err`.

  see

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

  #### Returns any

- - Defined in node_modules/@types/mocha/index.d.ts:2132

  Set the test `err`.

  see

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

  #### Parameters

  - ##### err: any

  #### Returns void

### fullTitle

- fullTitle(): string

- Inherited from Runnable.fullTitle

  - Defined in node_modules/@types/mocha/index.d.ts:1206

  Return the full title generated by recursively concatenating the parent's full title.

  #### Returns string

### globals

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

- Inherited from Runnable.globals

  - Defined in node_modules/@types/mocha/index.d.ts:1239

  Get a list of whitelisted globals for this test run.

  see

    https://mochajs.org/api/Runnable.html#globals

  #### Returns string[]

- Inherited from Runnable.globals

  - Defined in node_modules/@types/mocha/index.d.ts:1246

  Set a list of whitelisted globals for this test run.

  see

    https://mochajs.org/api/Runnable.html#globals

  #### Parameters

  - ##### globals: ReadonlyArray<string>

  #### Returns void

### inspect

- inspect(): string

- Inherited from Runnable.inspect

  - Defined in node_modules/@types/mocha/index.d.ts:1225

  Inspect the runnable void of private properties.

  see

    https://mochajs.org/api/Runnable.html#inspect

  #### Returns string

### isFailed

- isFailed(): boolean

- Inherited from Runnable.isFailed

  - Defined in node_modules/@types/mocha/index.d.ts:1168

  Return `true` if this Runnable has failed.

  #### Returns boolean

### isPassed

- isPassed(): boolean

- Inherited from Runnable.isPassed

  - Defined in node_modules/@types/mocha/index.d.ts:1173

  Return `true` if this Runnable has passed.

  #### Returns boolean

### isPending

- isPending(): boolean

- Inherited from Runnable.isPending

  - Defined in node_modules/@types/mocha/index.d.ts:1163

  Check if this runnable or its parent suite is marked as pending.

  see

    https://mochajs.org/api/Runnable.html#isPending

  #### Returns boolean

### resetTimeout

- resetTimeout(): void

- Inherited from Runnable.resetTimeout

  - Defined in node_modules/@types/mocha/index.d.ts:1232

  Reset the timeout.

  see

    https://mochajs.org/api/Runnable.html#resetTimeout

  #### Returns void

### retries

- retries(): number
- retries(n: number): void

- Inherited from Runnable.retries

  - Defined in node_modules/@types/mocha/index.d.ts:1180

  Set or get number of retries.

  see

    https://mochajs.org/api/Runnable.html#retries

  #### Returns number

- Inherited from Runnable.retries

  - Defined in node_modules/@types/mocha/index.d.ts:1187

  Set or get number of retries.

  see

    https://mochajs.org/api/Runnable.html#retries

  #### Parameters

  - ##### n: number

  #### Returns void

### run

- run(fn: Done): void

- Inherited from Runnable.run

  - Defined in node_modules/@types/mocha/index.d.ts:1253

  Run the test and invoke `fn(err)`.

  see

    https://mochajs.org/api/Runnable.html#run

  #### Parameters

  - ##### fn: Done

  #### Returns void

### skip

- skip(): never

- Inherited from Runnable.skip

  - Defined in node_modules/@types/mocha/index.d.ts:1156

  Halt and mark as pending.

  #### Returns never

### slow

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

- Inherited from Runnable.slow

  - Defined in node_modules/@types/mocha/index.d.ts:1130

  Get test slowness threshold.

  see

    https://mochajs.org/api/Runnable.html#slow

  #### Returns number

- Inherited from Runnable.slow

  - Defined in node_modules/@types/mocha/index.d.ts:1137

  Set test slowness threshold.

  see

    https://mochajs.org/api/Runnable.html#slow

  #### Parameters

  - ##### ms: string | number

  #### Returns this

### timeout

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

- Inherited from Runnable.timeout

  - Defined in node_modules/@types/mocha/index.d.ts:1116

  Get test timeout.

  see

    https://mochajs.org/api/Runnable.html#timeout

  #### Returns number

- Inherited from Runnable.timeout

  - Defined in node_modules/@types/mocha/index.d.ts:1123

  Set test timeout.

  see

    https://mochajs.org/api/Runnable.html#timeout

  #### Parameters

  - ##### ms: string | number

  #### Returns this

### titlePath

- titlePath(): string[]

- Inherited from Runnable.titlePath

  - Defined in node_modules/@types/mocha/index.d.ts:1211

  Return the title path generated by concatenating the parent's title path with the title.

  #### Returns string[]

Generated using TypeDoc