Mocha Documentation
Guides
- --allow-uncaught
- --async-only, -A
- --bail, -b
- --check-leaks
- --color, -c, --colors
- --compilers
- --config <path>
- --diff
- --dry-run
- --enable-source-maps
- --exit
- --extension <ext>
- --fail-zero
- --fgrep <string>, -f <string>
- --file <file>
- --forbid-only
- --forbid-pending
- --full-trace
- --global <variable-name>
- --grep <regexp>, -g <regexp>
- --ignore <file|directory|glob>, --exclude <file|directory|glob>,
- --inline-diffs
- --inspect, --inspect-brk, inspect
- --invert
- --jobs <count>, -j <count>
- --node-option <name>, -n <name>
- --opts <path>
- --package <path>
- --parallel, -p
- --pass-on-failing-test-suite
- --recursive
- --reporter <name>, -R <name>
- --reporter-option <option>, -O <option>, --reporter-options <option>
- --require <module>, -r <module>
- --retries <n>
- --slow <ms>, -s <ms>
- --sort, -S
- --timeout <ms>, -t <ms>
- --ui <name>, -u <name>
- --watch, -w
- --watch-files <file|directory|glob>
- --watch-ignore <file|directory|glob>
- About Option Types
- About V8 Flags
- About node Flags
- Arrow Functions
- Assertions
- Asynchronous Code
- Asynchronous Hooks
- Available Root Hooks
- BDD
- Browser Configuration
- Browser-specific Option(s)
- Caveats About Testing in Parallel
- Command-Line Usage
- Configuration Format
- Configuring Mocha (Node.js)
- Current Limitations
- Custom Locations
- Defining a Root Hook Plugin
- Delayed Root Suite
- Describing Hooks
- Detects Multiple Calls to done()
- Diffs
- Doc
- Dot Matrix
- Dynamically Generating Tests
- Editor Plugins
- Emacs
- Environment Variables
- Error Codes
- Examples
- Exclusive Tests
- Exclusive Tests are Disallowed
- Exports
- Extending Configuration
- File Order is Non-Deterministic
- Getting Started
- Global Fixtures
- Global Setup Fixtures
- Global Teardown Fixtures
- Grep
- HTML Reporter
- Hook-level
- Hooks
- Ignoring Config Files
- Inclusive Tests
- Installation
- Interfaces
- JSON
- JSON Stream
- JetBrains
- Landing Strip
- Limitations of asynchronous callbacks
- Limited Reporter API for Third-Party Reporters
- List
- Markdown
- Merging
- Migrating Tests to use Root Hook Plugins
- Migrating a Library to use Root Hook PLugins
- Min
- Mocha Sidebar (VS Code)
- More Information
- Multiple Root Hook Plugins
- Multiple Root Hooks in a Single Plugin
- No Browser Support
- Node.JS native ESM support
- Nyan
- Parallel Mode
- Parallel Mode Worker IDs
- Parallel Tests
- Pending Tests
- Priorities
- Progress
- QUnit
- Reporter Limitations
- Reporters
- Reporting
- Require
- Retry Tests
- Root Hook Plugins
- Root Hook Plugins Can Export a Function
- Root Hooks Are Not Global
- Root-Level Hooks
- Run Cycle Overview
- Running Mocha in the Browser
- Serial Mode
- Spec
- Sponsors
- Suite-level
- Synchronous Code
- TAP
- TDD
- Test Duration Variability
- Test Fixture Decision-Tree Wizard Thing
- Test duration
- Test-level
- Testing Mocha
- TextMate
- The test/ Directory
- Third-Party Reporters
- Timeouts
- Troubleshooting Parallel Mode
- Using async / await
- Wallaby.js
- When Not To Use Global Fixtures
- When To Use Global Fixtures
- Working with Promises
- XUnit
- “Bail” is “Best Effort”