Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

AsyncFunc

AsyncFunc: (this: Context) => PromiseLike<any>

Type declaration

Done

Done: (err?: any) => void

Type declaration

    • (err?: any): void
    • Parameters

      • Optional err: any

      Returns void

Func

Func: (this: Context, done: Done) => void

Type declaration

    • Callback function used for tests and hooks.

      Parameters

      Returns void

Interface

Interface: keyof InterfaceContributions

Reporter

Reporter: keyof ReporterContributions

TestInterface

TestInterface: (suite: Suite) => void

Type declaration

    • Parameters

      Returns void

Variables

Let describe

describe: SuiteFunction

Describe a "suite" containing nested suites and tests.

  • Only available when invoked via the mocha CLI.

Let it

Describes a test case.

  • Only available when invoked via the mocha CLI.

Let suite

Describe a "suite" containing nested suites and tests.

  • Only available when invoked via the mocha CLI.

Let test

Describes a test case.

  • Only available when invoked via the mocha CLI.

Functions

Let after

Let afterEach

  • afterEach(fn: Func): void
  • afterEach(fn: AsyncFunc): void
  • afterEach(name: string, fn?: Func): void
  • afterEach(name: string, fn?: AsyncFunc): void

Let before

  • before(fn: Func): void
  • before(fn: AsyncFunc): void
  • before(name: string, fn?: Func): void
  • before(name: string, fn?: AsyncFunc): void

Let beforeEach

  • beforeEach(fn: Func): void
  • beforeEach(fn: AsyncFunc): void
  • beforeEach(name: string, fn?: Func): void
  • beforeEach(name: string, fn?: AsyncFunc): void

run

  • run(): void
  • Triggers root suite execution.

    • Only available if flag --delay is passed into Mocha.
    • Only available when invoked via the mocha CLI.
    see

    https://mochajs.org/api/global.html#runWithSuite

    Returns void

Let setup

Let suiteSetup

  • suiteSetup(fn: Func): void
  • suiteSetup(fn: AsyncFunc): void
  • suiteSetup(name: string, fn?: Func): void
  • suiteSetup(name: string, fn?: AsyncFunc): void

Let suiteTeardown

  • suiteTeardown(fn: Func): void
  • suiteTeardown(fn: AsyncFunc): void
  • suiteTeardown(name: string, fn?: Func): void
  • suiteTeardown(name: string, fn?: AsyncFunc): void

Let teardown

  • teardown(fn: Func): void
  • teardown(fn: AsyncFunc): void
  • teardown(name: string, fn?: Func): void
  • teardown(name: string, fn?: AsyncFunc): void

Let xit

  • Describes a pending test case.

    • Only available when invoked via the mocha CLI.

    Parameters

    Returns Test

  • Describes a pending test case.

    • Only available when invoked via the mocha CLI.

    Parameters

    Returns Test

  • Describes a pending test case.

    • Only available when invoked via the mocha CLI.

    Parameters

    • title: string
    • Optional fn: Func

    Returns Test

  • Describes a pending test case.

    • Only available when invoked via the mocha CLI.

    Parameters

    Returns Test