LinuxCommandLibrary

mocha

JavaScript test framework

TLDR

Run tests
$ mocha
copy
Run specific file
$ mocha [test/spec.js]
copy
Watch mode
$ mocha --watch
copy
Run with grep
$ mocha --grep "[pattern]"
copy
Reporter style
$ mocha --reporter [spec]
copy
Recursive tests
$ mocha --recursive
copy

SYNOPSIS

mocha [options] [files]

DESCRIPTION

mocha is a JavaScript test framework. It runs in Node.js and browsers.
The tool provides BDD/TDD testing styles. Supports async tests and many reporters.

PARAMETERS

FILES

Test files to run.
--watch
Watch for changes.
--grep PATTERN
Filter tests.
--reporter NAME
Output format.
--recursive
Include subdirectories.
--timeout MS
Test timeout.
--help
Display help information.

CAVEATS

Node.js required. Requires assertion library. Configuration via .mocharc.

HISTORY

Mocha was created by TJ Holowaychuk as a feature-rich JavaScript test framework.

SEE ALSO

jest(1), jasmine(1), npm(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard