Options
All
  • Public
  • Public/Protected
  • All
Menu

External module utils/mocha

Helpers to run Mocha.

Index

Variables

Const MOCHA_BIN

MOCHA_BIN: Furi = new Furi(fromSysPath(require.resolve("mocha/bin/mocha")))

Absolute path to the Mocha CLI script.

Functions

execMocha

  • Runs the Mocha CLI with the provided arguments.

    Parameters

    • Default value args: string[] = []

      Array of CLI arguments.

    • Default value experimentalModules: boolean = false

      Use --experimental-modules.

    • Optional options: SpawnOptions

      Extra options for the spawned process.

    Returns Promise<SpawnResult>

    Promise for the execution result.

getCommand

getCommandArgs

getSources

  • getSources(baseDir: Furi, specPattern: string): Sources
  • Resolve locations of the Mocha spec files.

    Parameters

    • baseDir: Furi

      Base directory to resolve the patterns.

    • specPattern: string

      Minimatch pattern for the spec files.

    Returns Sources

    Resolved locations.

run

  • Runs Mocha BDD tests with the provided options.

    Parameters

    Returns Promise<void>

    Promise resolved once the tests end. If Mocha ends with a non-zero exit code, the promise is rejected with the TestError error.

Generated using TypeDoc