Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

HTMLLIElement

HTMLLIElement: { prototype: HTMLLIElement }

Type declaration

Window

Window: { prototype: Window }

Type declaration

context

context: SuiteFunction

Describe a "suite" containing nested suites and tests.

  • Only available when invoked via the mocha CLI.

describe

describe: SuiteFunction

Describe a "suite" containing nested suites and tests.

  • Only available when invoked via the mocha CLI.

it

Describes a test case.

  • Only available when invoked via the mocha CLI.

Const mocha

Mocha global.

  • Only supported in the browser.

specify

specify: TestFunction

Describes a test case.

  • Only available when invoked via the mocha CLI.

suite

Describe a "suite" containing nested suites and tests.

  • Only available when invoked via the mocha CLI.

test

Describes a test case.

  • Only available when invoked via the mocha CLI.

Functions

after

afterEach

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

before

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

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

setup

suiteSetup

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

suiteTeardown

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

teardown

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

xcontext

  • xcontext(title: string, fn: () => void): void | Suite
  • Pending suite.

    • Only available when invoked via the mocha CLI.

    Parameters

    • title: string
    • fn: () => void
        • (): void
        • Returns void

    Returns void | Suite

xdescribe

  • xdescribe(title: string, fn: () => void): void | Suite
  • Pending suite.

    • Only available when invoked via the mocha CLI.

    Parameters

    • title: string
    • fn: () => void
        • (): void
        • Returns void

    Returns void | Suite

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

xspecify

  • 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