# mochajs/mocha

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Repository: https://github.com/mochajs/mocha
Canonical: https://ross.abutalabs.com/products/mocha
Homepage: https://mochajs.org
Language: JavaScript
License: MIT
License Family: permissive
Topics: mocha, javascript, testing, tdd, bdd, browser, nodejs, mochajs, node, test, test-framework, testing-tools
Last push: 2026-08-26T17:50:44+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 96, longevity 100
- inputs: {"age_days": 5658, "days_push": 7, "days_rel": 31, "gap_med": 18.0, "n_releases_24m": 23}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 22905, forks 3157 (observed 2026-08-28T04:11:34.217088+00:00)

## What it is
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
- artifact type: framework
- maturity: stable
- function: testing, e2e-testing, cli
- domain: testing, developer-tools, web-development
- platform: browser, cli, cross-platform
- tags: test-framework, tdd, bdd, javascript, mocha, unit-testing, async-testing, nodejs

## Member repositories
- mochajs/mocha (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:34.217088+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:56:50.582539+00:00, confidence not recorded.
  - readme: https://github.com/mochajs/mocha (fetched 2026-08-28T04:11:34.217088+00:00, sha 784ef30619db)
  - homepage: https://mochajs.org (fetched 2026-08-29T07:55:28.176901+00:00, sha 42c6e6d3530b)
  - site_page: https://mochajs.org/features/assertions (fetched 2026-08-29T07:55:28.183371+00:00, sha a53abfbd0bc0)
  - site_page: https://mochajs.org/getting-started (fetched 2026-08-29T07:55:28.179645+00:00, sha c5e5008b0bdd)
  - site_page: https://mochajs.org/features/arrow-functions (fetched 2026-08-29T07:55:28.181677+00:00, sha 2414b2808a52)
  - site_page: https://mochajs.org/features/asynchronous-code (fetched 2026-08-29T07:55:28.185763+00:00, sha 394b7a0824e0)
  - site_page: https://mochajs.org/features/diffs (fetched 2026-08-29T07:55:28.188374+00:00, sha dfd5e9467f73)
  - site_page: https://mochajs.org/features/error-codes (fetched 2026-08-29T07:55:28.190504+00:00, sha 671e3979283f)
  - site_page: https://mochajs.org/features/global-fixtures (fetched 2026-08-29T07:55:28.192218+00:00, sha 23e52985ecd5)
  - site_page: https://mochajs.org/features/hooks (fetched 2026-08-29T07:55:28.194106+00:00, sha f61a13e262f8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
