.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8. .TH MOCHA "1" "January 2021" "mocha 8.2.1" "User Commands" .SH NAME mocha \- simple, flexible, fun test framework .SH DESCRIPTION mocha [spec..] .PP Run tests with Mocha .PP Commands .TP mocha inspect [spec..] Run tests with Mocha [default] .TP mocha init create a client\-side Mocha setup at .PP Rules & Behavior .TP \fB\-\-allow\-uncaught\fR Allow uncaught errors to propagate [boolean] .TP \fB\-\-async\-only\fR, \fB\-A\fR Require all tests to use a callback (async) or return a Promise [boolean] .TP \fB\-\-bail\fR, \fB\-b\fR Abort ("bail") after first test failure [boolean] .TP \fB\-\-check\-leaks\fR Check for global variable leaks [boolean] .TP \fB\-\-delay\fR Delay initial execution of root suite [boolean] .TP \fB\-\-exit\fR Force Mocha to quit after tests complete [boolean] .TP \fB\-\-forbid\-only\fR Fail if exclusive test(s) encountered [boolean] .TP \fB\-\-forbid\-pending\fR Fail if pending test(s) encountered [boolean] .TP \fB\-\-global\fR, \fB\-\-globals\fR List of allowed global variables [array] .TP \fB\-\-jobs\fR, \fB\-j\fR Number of concurrent jobs for \fB\-\-parallel\fR; use 1 to run in serial .IP [number] [default: (number of CPU cores \- 1)] .TP \fB\-\-parallel\fR, \fB\-p\fR Run tests in parallel [boolean] .TP \fB\-\-retries\fR Retry failed tests this many times [number] .TP \fB\-\-slow\fR, \fB\-s\fR Specify "slow" test threshold (in milliseconds) [string] [default: 75] .TP \fB\-\-timeout\fR, \fB\-t\fR, \fB\-\-timeouts\fR Specify test timeout threshold (in milliseconds) [string] [default: 2000] .TP \fB\-\-ui\fR, \fB\-u\fR Specify user interface [string] [default: "bdd"] .PP Reporting & Output .TP \fB\-\-color\fR, \fB\-c\fR, \fB\-\-colors\fR Force\-enable color output [boolean] .TP \fB\-\-diff\fR Show diff on failure [boolean] [default: true] .TP \fB\-\-full\-trace\fR Display full stack traces [boolean] .TP \fB\-\-growl\fR, \fB\-G\fR Enable Growl notifications [boolean] .TP \fB\-\-inline\-diffs\fR Display actual/expected differences inline within each string [boolean] .TP \fB\-\-reporter\fR, \fB\-R\fR Specify reporter to use [string] [default: "spec"] .TP \fB\-\-reporter\-option\fR, \fB\-\-reporter\-options\fR, Reporter\-specific options .TP \fB\-O\fR () [array] .PP Configuration .TP \fB\-\-config\fR Path to config file [string] [default: (nearest rc file)] .TP \fB\-\-package\fR Path to package.json for config [string] .PP File Handling .TP \fB\-\-extension\fR File extension(s) to load [array] [default: ["js","cjs","mjs"]] .TP \fB\-\-file\fR Specify file(s) to be loaded prior to root suite execution [array] [default: (none)] .TP \fB\-\-ignore\fR, \fB\-\-exclude\fR Ignore file(s) or glob pattern(s) [array] [default: (none)] .TP \fB\-\-recursive\fR Look for tests in subdirectories [boolean] .TP \fB\-\-require\fR, \fB\-r\fR Require module [array] [default: (none)] .TP \fB\-\-sort\fR, \fB\-S\fR Sort test files [boolean] .TP \fB\-\-watch\fR, \fB\-w\fR Watch files in the current working directory for changes [boolean] .TP \fB\-\-watch\-files\fR List of paths or globs to watch [array] .TP \fB\-\-watch\-ignore\fR List of paths or globs to exclude from watching [array] [default: ["node_modules",".git"]] .PP Test Filters .TP \fB\-\-fgrep\fR, \fB\-f\fR Only run tests containing this string [string] .TP \fB\-\-grep\fR, \fB\-g\fR Only run tests matching this string or regexp [string] .TP \fB\-\-invert\fR, \fB\-i\fR Inverts \fB\-\-grep\fR and \fB\-\-fgrep\fR matches [boolean] .PP Positional Arguments .TP spec One or more files, directories, or globs to test .IP [array] [default: ["test"]] .SH OPTIONS .TP \fB\-\-help\fR, \fB\-h\fR Show usage information & exit [boolean] .TP \fB\-\-version\fR, \fB\-V\fR Show version number & exit [boolean] .TP \fB\-\-list\-interfaces\fR List built\-in user interfaces & exit [boolean] .TP \fB\-\-list\-reporters\fR List built\-in reporters & exit [boolean] .PP Mocha Resources .IP Chat: https://gitter.im/mochajs/mocha .IP GitHub: https://github.com/mochajs/mocha.git .IP Docs: https://mochajs.org/