Skip to content
Agents tracked: 378 Downloads (7d): 244M down 5.7% GitHub stars: 8.4M VS Code installs: 151M Releases (7d): 407 Agent status: 1 with issues Updated Oct 10, 2026

Mocha

Feature-rich JavaScript test framework for Node.js and browsers.

Testing npm MIT

Used in agent projects
281
2.2% of 12,697 public repos built with AI coding agents
Rank in testing
#8 of 40
by use in those projects
Downloads
12.6M
npm, last 7 days, mocha
GitHub stars
22.9K
last push Oct 10, 2026

How Mocha is used

Mocha is a dependency in 281 of the 12,697 public GitHub projects set up for AI coding agents that we scanned (2.2%), #8 of 40 in testing. The most used alternative there is Vitest. Projects that use it most often also use Chai (90.4%), Solana Web3.js (77.9%), ts-mocha (66.9%).

Often used with Mocha

Chai90.4% of Mocha projects · 37.6× more than average
Solana Web3.js77.9% of Mocha projects · 4.7× more than average
ts-mocha66.9% of Mocha projects · 44.5× more than average
Solana SPL Token56.6% of Mocha projects · 7.8× more than average
Prettier60.9% of Mocha projects · 3.5× more than average
Anchor51.2% of Mocha projects · 14.9× more than average
TypeScript89.3% of Mocha projects · 1.6× more than average
ts-node30.6% of Mocha projects · 4.5× more than average

By coding agent

GitHub Copilot0.7% of projects set up for it
Claude Code0.5% of projects set up for it
Cursor0.3% of projects set up for it

Share of public repos configured for each agent that list Mocha as a dependency.

Install

Packagenpm install mocha
Main stacksRust (182), TypeScript / JavaScript (85), Next.js (9), React Native / Expo (3)
Example projectsbuffalojoec/arb-program, m8s-lab/pump-fun-smart-contract, Ortus-Solutions/ContentBox, blockworks-foundation/mango-v4, ironaddicteddog/anchor-amm

Alternatives to Mocha

All testing

Tool Used in agent projectsDownloads / wk GitHub starsLicense
Vitest npm
Next-generation testing framework powered by Vite with native ESM.
1,549 (12.2%) 123M 17.2K MIT
Playwright (JavaScript) npm
Cross-browser automation library for end-to-end testing.
1,117 (8.8%) 74.2M 97.4K Apache-2.0
Testing Library npm
Testing utilities for React encouraging testing user behavior.
915 (7.2%) 68.7M 19.7K MIT
Jest npm
Delightful JavaScript testing framework with minimal configuration.
702 (5.5%) 46.3M 45.6K MIT
jsdom npm
JavaScript implementation of web standards for testing DOM interactions.
681 (5.4%) 112M 21.7K MIT
pytest pypi
Simple, powerful Python testing framework with fixtures and plugins.
330 (2.6%) 196M 14.6K —
Chai npm
BDD/TDD assertion library for Node.js and browsers with expressive syntax.
305 (2.4%) 14M 8,265 MIT
ts-mocha npm
Mocha wrapper for running TypeScript tests directly with ts-node without compilation.
191 (1.5%) 573K 196 MIT
Is Mocha right for your project? Ask AgentGid →