mochajs/mocha
☕️ Classic, reliable, trusted test framework for Node.js and the browser observed · 2026-08-28
Health v2 · maintenance only
98/100
- Activity 99
- Release rhythm 96
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 18.0
- age_days: 5658
- days_rel: 31
- days_push: 7
- n_releases_24m: 23
Adoption not part of the score
22905 stars · 3157 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
Mocha is a feature-rich JavaScript test framework that runs on Node.js and in the browser, supporting TDD and BDD styles with flexible interfaces and reporters. It handles asynchronous testing via callbacks, promises, or async/await, and lets you pair it with any assertion library such as Chai.
Use cases
- run unit tests for a node.js project
- test asynchronous javascript code with promises
- write bdd-style tests with describe and it
- run javascript tests in the browser
- set up before and after hooks for test fixtures
- generate test reports with custom reporters
- run tests in parallel with global setup and teardown
When to choose
- you need a mature, battle-tested test runner for Node.js or browser JavaScript
- you want freedom to choose any assertion library
- you need flexible async testing with callbacks, promises, or async/await
- you want serial test execution with accurate reporting and error mapping
When to avoid
- you prefer an all-in-one framework with built-in assertions and mocking like Jest or Vitest
- you want a modern runner with native ESM/TypeScript support out of the box
- you need snapshot testing as a first-class feature
Facets
framework · maturity stable
testing e2e-testing cli testing developer-tools web-development browser cli cross-platform test-framework tdd bdd javascript mocha unit-testing async-testing nodejs
10 sources
- readme: https://github.com/mochajs/mocha · fetched 2026-08-28 · 784ef30619db
- homepage: https://mochajs.org · fetched 2026-08-29 · 42c6e6d3530b
- site_page: https://mochajs.org/features/assertions · fetched 2026-08-29 · a53abfbd0bc0
- site_page: https://mochajs.org/getting-started · fetched 2026-08-29 · c5e5008b0bdd
- site_page: https://mochajs.org/features/arrow-functions · fetched 2026-08-29 · 2414b2808a52
- site_page: https://mochajs.org/features/asynchronous-code · fetched 2026-08-29 · 394b7a0824e0
- site_page: https://mochajs.org/features/diffs · fetched 2026-08-29 · dfd5e9467f73
- site_page: https://mochajs.org/features/error-codes · fetched 2026-08-29 · 671e3979283f
- site_page: https://mochajs.org/features/global-fixtures · fetched 2026-08-29 · 23e52985ecd5
- site_page: https://mochajs.org/features/hooks · fetched 2026-08-29 · f61a13e262f8
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| mochajs/mocha | main | 98 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem