# Feature catalog — mochajs/mocha

> Canonical page: https://codevetter.com/unpack/mocha/feature-catalog

# Feature catalog — mochajs/mocha

Scanned commit 79db2ee53b863813b97bf2a74cafa1599115c074 (2026-10-01). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

Mocha exposes test execution and browser scaffolding through its CLI, plus direct construction and execution through its library API. Test declarations support multiple interfaces, hooks, selection, skipping, and retries. Reporters offer terminal, browser, structured, and CI-oriented output. Parallel and watch modes alter execution scheduling and lifecycle management.
- The CLI supports default test execution, init <path>, help, version, and interface/reporter listing; init writes a browser bundle, stylesheet, HTML runner, and empty test file. — [lib/cli/cli.js#L118-L136](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/cli/cli.js#L118-L136) [lib/cli/run-option-metadata.cjs#L127-L129](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/cli/run-option-metadata.cjs#L127-L129) [lib/cli/init.js#L23-L35](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/cli/init.js#L23-L35)
- Built-in interfaces are BDD, TDD, QUnit, and exports; BDD provides describe/context, it/specify, four hook functions, and only/skip variants. — [lib/interfaces/index.js#L1-L11](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/interfaces/index.js#L1-L11) [lib/interfaces/bdd.js#L27-L46](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/interfaces/bdd.js#L27-L46) [lib/interfaces/bdd.js#L53-L109](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/interfaces/bdd.js#L53-L109)
- Runnable supports synchronous functions, callbacks, and thenables; callback completion checks for a returned Promise once its result is available, and repeated completion emits a multiple-done error. — [lib/runnable.js#L278-L304](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/runnable.js#L278-L304) [lib/runnable.js#L319-L343](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/runnable.js#L319-L343) [lib/runnable.js#L359-L413](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/runnable.js#L359-L413)
- Selection and run-policy options include grep/fgrep/invert, retries, bail, dry-run, fail-zero, forbid-only, forbid-pending, global leak checking, and forced exit. — [lib/cli/run-option-metadata.cjs#L98-L126](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/cli/run-option-metadata.cjs#L98-L126) [lib/cli/run-option-metadata.cjs#L139-L143](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/cli/run-option-metadata.cjs#L139-L143) [lib/runner.js#L1197-L1224](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/runner.js#L1197-L1224)
- The reporter registry includes Spec, Dot, List, Min, TAP, JSON, JSON Stream, XUnit, HTML, Doc, Markdown, Progress, Landing, Nyan, and GitHub Actions, with normalized name aliases. — [lib/reporters/index.cjs#L5-L36](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/reporters/index.cjs#L5-L36)
- Parallel mode supports jobs-based file concurrency but rejects --file, --sort, and progress/markdown/json-stream reporters; workers force forbidOnly. — [lib/cli/run.cjs#L104-L121](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/cli/run.cjs#L104-L121) [lib/nodejs/worker.cjs#L98-L105](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/nodejs/worker.cjs#L98-L105) [lib/cli/run-option-metadata.cjs#L127-L133](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/cli/run-option-metadata.cjs#L127-L133)
- Watch mode supports file and ignore patterns, automatic reruns, the rs keyboard shortcut, and global teardown on SIGINT. — [lib/cli/watch-run.cjs#L440-L495](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/cli/watch-run.cjs#L440-L495) [lib/cli/watch-run.cjs#L518-L541](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/cli/watch-run.cjs#L518-L541)
- Users can supply required-module root hook/global fixture plugins, custom reporters and interfaces, or programmatically load files and run; browser setup additionally accepts query-based grep, fgrep, and invert. — [lib/plugin-loader.js#L25-L120](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/plugin-loader.js#L25-L120) [lib/mocha.cjs#L310-L387](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/mocha.cjs#L310-L387) [lib/mocha.cjs#L438-L452](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/lib/mocha.cjs#L438-L452) [browser-entry.js#L140-L179](https://github.com/mochajs/mocha/blob/79db2ee53b863813b97bf2a74cafa1599115c074/browser-entry.js#L140-L179)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
