MOCHA(1)

NAME
mocha - simple, flexible, fun test framework

SYNOPSIS
Usage: mocha [debug] [options] [files]

DESCRIPTION
Mocha is a feature-rich JavaScript test framework running on Node.js and browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.

COMMANDS

inspect [spec..]
    run tests with Mocha [default]

init <path>
    initialize a client-side mocha setup at <path>

RULES & BEHAVIOR

--allow-uncaught
    Allow uncaught errors to propagate [boolean]

--async-only, -A
    Require all tests to use a callback (async) or return a Promise [boolean]

--bail, -b
    Abort ("bail") after first test failure [boolean]

--check-leaks
    Check for global variable leaks [boolean]

--delay
    Delay initial execution of root suite [boolean]

--exit
    Force Mocha to quit after tests complete [boolean]

--forbid-only
    Fail if exclusive test(s) encountered [boolean]

--forbid-pending
    Fail if pending test(s) encountered [boolean]

--global, --globals
    List of allowed global variables [array]

--retries
    Retry failed tests this many times [number]

--slow, -s
    Specify "slow" test threshold (in milliseconds) [string] [default: 75]

--timeout, -t, --timeouts
    Specify test timeout threshold (in milliseconds) [string] [default: 2000]

--ui, -u
    Specify user interface [string] [default: "bdd"]

REPORTING & OUTPUT

--color, -c, --colors
    Force-enable color output [boolean]

--diff
    Show diff on failure [boolean] [default: true]

--full-trace
    Display full stack traces [boolean]

--growl, -G
    Enable Growl notifications [boolean]

--inline-diffs
    Display actual/expected differences inline within each string [boolean]

--reporter, -R
    Specify reporter to use [string] [default: "spec"]

--reporter-option, --reporter-options,
    Reporter-specific options

-O  (<k=v,[k1=v1,..]>) [array]

CONFIGURATION

--config
    Path to config file [string] [default: (nearest rc file)]

--opts
    Path to `mocha.opts` (DEPRECATED) [string] [default: "./test/mocha.opts"]

--package
    Path to package.json for config [string]

FILE HANDLING

--extension
    File extension(s) to load [array] [default: js]

--file
    Specify file(s) to be loaded prior to root suite execution [array] [default: (none)]

--ignore, --exclude
    Ignore file(s) or glob pattern(s) [array] [default: (none)]

--recursive
    Look for tests in subdirectories [boolean]

--require, -r
    Require module [array] [default: (none)]

--sort, -S
    Sort test files [boolean]

--watch, -w
    Watch files in the current working directory for changes [boolean]

--watch-files
    List of paths or globs to watch [array]

--watch-ignore
    List of paths or globs to exclude from watching [array] [default: ["node_modules",".git"]]

TEST FILTERS

--fgrep, -f
    Only run tests containing this string [string]

--grep, -g
    Only run tests matching this string or regexp [string]

--invert, -i
    Inverts --grep and --fgrep matches [boolean]

POSITIONAL ARGUMENTS

spec
    One or more files, directories, or globs to test

    [array] [default: ["test"]]

OTHER OPTIONS

--help, -h
    Show usage information & exit [boolean]

--version, -V
    Show version number & exit [boolean]

--list-interfaces
    List built-in user interfaces & exit [boolean]

--list-reporters
    List built-in reporters & exit [boolean]

SEE ALSO
More info about mocha can be found in https://mochajs.org/

AUTHOR
This man page was created by Leo Iannacone <l3on@ubuntu.com> using output of mocha --help License GPLv3+: GNU GPL version 3 or later
   <http://gnu.org/licenses/gpl.html>.