mocha README

The project's README from github.com/mochajs/mocha. As one markdown file: README.md.

Mocha test framework logo

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

npm version 12.0.1-9.3 Node Version GitHub Actions Build Status Codecov Coverage Status

Chat - Discord OpenCollective Sponsors OpenCollective Backers Collective Funds Guidelines v0.1

Backers

Become a backer and show your support to our open source project on our site.

Mocha's backers on Open Collective

Sponsors

Does your company use Mocha? Ask your manager or marketing team if your company would be interested in supporting our project. Support will allow the maintainers to dedicate more time for maintenance and new features for everyone. Also, your company's logo will show on GitHub and on our site - who doesn't want a little extra exposure? Here's the info.

MochaJS Sponsor MochaJS Sponsor MochaJS Sponsor MochaJS Sponsor

Development

You might want to know that:

You might want to help:

Finally, come chat with the maintainers on Discord if you want to help with:

License

Copyright 2011-2024 OpenJS Foundation and contributors. Licensed MIT.

mocha (mochajs/mocha)

Searching Database…

22.9K ·GitHub
What is this?Mocha is a classic, battle-tested test framework for JavaScript — you write test suites that run on Node.js or directly in the browser.
Is it a library I call from my code, or a tool I run?A framework rather than a plain library: install it from npm, describe your tests in spec files, then run them with the mocha command; both BDD and TDD styles are supported.
How do I add it to my project?Add it with npm install --save-dev mocha, then point the mocha command at your test files; the docs at mochajs.org walk through the rest.
Which Node.js version do I need?Per its package engines field: ^20.19.0 or >=22.12.0 — so any current Node LTS release works.
Can I use it for free in commercial projects?Yes — it's MIT-licensed, with copyright held by the OpenJS Foundation and contributors since 2011.
Why do teams still pick Mocha over newer test runners?Scale and track record: it's one of the most-depended-upon modules on npm, has been around since 2011, and counts roughly 23k GitHub stars — about as proven as JavaScript tooling gets.
Will my tests rerun automatically while I code?Yes — Mocha ships a watch mode; it uses chokidar under the hood to watch files and rerun tests when they change.
What are similar projects?vitest, Catch2, ava, testify, pest, jasmine, enzyme, jsdom
Creator
mochajs
Size
32.3 MB
Stars
22.9K
Age
15y
Commits · 90 Days