commands.sh

mocha

all

A feature-rich JavaScript test framework.

More info →

Options (3)

-g, --grepboolean

Run tests that match a specific `grep` pattern

Example: mocha {{[-g|--grep]}} {{regex}}
-w, --watchboolean

Run tests on changes to JavaScript files in the current directory and once initially

Example: mocha {{[-w|--watch]}}
-R, --reporterboolean

Run tests with a specific reporter

Example: mocha {{[-R|--reporter]}} {{reporter}}

Examples (5)

Run tests with default configuration or as configured in `mocha.opts`

Run tests contained at a specific location

mocha path/to/test_directory

Run tests that match a specific `grep` pattern

mocha [-g|--grep] regex

Run tests on changes to JavaScript files in the current directory and once initially

mocha [-w|--watch]

Run tests with a specific reporter

mocha [-R|--reporter] reporter
made by @shridhargupta | data from tldr-pages