Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mocha

Hierarchy

  • Mocha

Index

Constructors

constructor

  • new Mocha(options?: object): Mocha
  • Parameters

    • Optional options: object
      • Optional bail?: boolean
      • Optional grep?: RegExp
      • Optional reporter?: string
      • Optional timeout?: number
      • Optional ui?: string

    Returns Mocha

Properties

currentTest

currentTest: ITestDefinition

Methods

addFile

  • addFile(file: string): Mocha

asyncOnly

  • asyncOnly(value: boolean): Mocha

bail

  • bail(value?: boolean): Mocha

checkLeaks

enableTimeouts

  • enableTimeouts(value: boolean): Mocha

globals

  • globals(value: string): Mocha
  • globals(values: string[]): Mocha

grep

  • grep(value: string): Mocha
  • grep(value: RegExp): Mocha

growl

ignoreLeaks

  • ignoreLeaks(value: boolean): Mocha

invert

noHighlighting

  • noHighlighting(value: boolean): Mocha

reporter

  • reporter(name: string): Mocha
  • reporter(reporter: function): Mocha

run

  • run(onComplete?: function): IRunner
  • Runs tests and invokes onComplete() when finished.

    Parameters

    • Optional onComplete: function
        • (failures: number): void
        • Parameters

          • failures: number

          Returns void

    Returns IRunner

setup

slow

  • slow(value: number): Mocha

throwError

  • throwError(error: Error): void
  • Function to allow assertion libraries to throw errors directly into mocha. This is useful when running tests in a browser because window.onerror will only receive the 'message' attribute of the Error.

    Parameters

    • error: Error

    Returns void

timeout

  • timeout(value: number): Mocha

ui

  • ui(value: string): Mocha

useColors

  • useColors(value: boolean): Mocha

useInlineDiffs

  • useInlineDiffs(value: boolean): Mocha

Generated using TypeDoc