Skip to content
Mocha
Search
Ctrl
K
Cancel
Discord
GitHub
Select theme
Dark
Light
Auto
Getting Started
Running Mocha
Browsers
CLI
Configuring
Editor plugins
Test globs
Declaring Tests
Dynamic tests
Exclusive tests
Inclusive tests
Pending tests
Retrying tests
Features
Arrow functions
Assertions
Asynchronous code
Diffs
Error codes
Global fixtures
Hooks
Parallel mode
Root hook plugins
Timeouts
Interfaces
About
BDD (default)
Exports
QUnit
Require
TDD
Third-Party
Reporters
About
Doc
Dot
HTML
JSON Stream
JSON
Landing
List
Markdown
Min
Nyan
Progress
Spec (default)
Tap
Third-Party
XUnit
Explainers
Detecting multiple calls to done()
Counting assertions
Find global leaks
Node.js native ESM support
Related tools
Run cycle overview
Shared behaviours
Spies
Tagging with --grep
Test duration
Test fixture decision tree
Third party reporters
Third party UIs
API
Discord
GitHub
Select theme
Dark
Light
Auto
Related tools
Related Tools
Assertion Libraries
chai
(recommended): expect(), assert(), and should style assertions
earl
: ergonomic, modern and type-safe assertion library for TypeScript
unexpected
: extensible BDD assertion toolkit
Mocks, Stubs & Spies
sinon.js
: Test spies, stubs and mocks for JavaScript.
nock
: HTTP mocking and expectations library.