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
| Chai | 90.4% of Mocha projects · 37.6× more than average |
|---|---|
| Solana Web3.js | 77.9% of Mocha projects · 4.7× more than average |
| ts-mocha | 66.9% of Mocha projects · 44.5× more than average |
| Solana SPL Token | 56.6% of Mocha projects · 7.8× more than average |
| Prettier | 60.9% of Mocha projects · 3.5× more than average |
| Anchor | 51.2% of Mocha projects · 14.9× more than average |
| TypeScript | 89.3% of Mocha projects · 1.6× more than average |
| ts-node | 30.6% of Mocha projects · 4.5× more than average |
By coding agent
| GitHub Copilot | 0.7% of projects set up for it |
|---|---|
| Claude Code | 0.5% of projects set up for it |
| Cursor | 0.3% of projects set up for it |
Share of public repos configured for each agent that list Mocha as a dependency.
Install
| Package | npm install mocha |
|---|---|
| Main stacks | Rust (182), TypeScript / JavaScript (85), Next.js (9), React Native / Expo (3) |
| Example projects | buffalojoec/arb-program, m8s-lab/pump-fun-smart-contract, Ortus-Solutions/ContentBox, blockworks-foundation/mango-v4, ironaddicteddog/anchor-amm |
Alternatives to Mocha
| Tool | Used in agent projects | Downloads / wk | GitHub stars | License |
|---|---|---|---|---|
| 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 |