Skip to content

Mocha 12 RC 1 is here!

Mocha 12 is the first release to follow our even-odd major release pattern. As an even release, Mocha 12 introduces very few breaking changes: We’ve bumped our Node floor, removed some long-deprecated features, and modernized a bit, but everything else works just as before.

These notes cover all changes in our first release candidate, 12.0.0-rc.1. The baseline is 11.7.4, after which we started releasing betas. To view the full changelog, see CHANGELOG.md on Github.

As a release candidate, RC 1 contains all the features that will be in 12.0.0. We will work to fix bugs for future release candidates, then release a stable 12.0.0 when it’s ready.

We will continue to support critical bugfixes in Mocha 11 while customers upgrade to Mocha 12. We’ve also deployed v11.mochajs.org for users that may rely on Mocha 11 in the long-term.

You can try the RC now with a standard install:

Terminal window
npm i -D mocha@12.0.0-rc.1
  • As mentioned in breaking changes, Mocha is now an ESM-first package, using "type": "module" instead of "type": "commonjs" in package.json. This should not be a breaking change for the vast majority of users; CJS consumers can still require('mocha') just as before, thanks to new support in Node 20.19.0 and 22.12.0. We’ve marked it as “breaking” for users that depend on Mocha’s internal structure for any reason. ESM is the modern, canonical way of managing modules, supported officially by the ECMAScript spec. CJS was always a placeholder approach until a better solution came along. (#5400)
  • Mocha now uses Playwright instead of Karma for its internal tests. This is not a user-facing change in any way, but it means that Mocha contributors can now use a modern browser automation library instead of the long-deprecated Karma approach. This will help us better support browser-based testing in the future. (#6031)

Mocha development could not continue without the support of contributors who have opened issues, submitted PRs, and commented in discussions. 98 merged PRs for Mocha 12 were opened by community members! We are also very grateful to our many financial donors.

Mocha continues to thrive thanks to all of these generous contributions. Thank you.

As always, you can open an issue on GitHub or message us on Discord for support 🤎