npm / mocha
mocha
What changed in mocha 11 to 12, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
1 breaking2 new APIs and options15 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initmocha 1214 changes
Breaking changes 1
Nested tests now fail when a beforeEach hook fails.
New APIs and options 1
Supports one-character aliases using the --X form.
Fixes and other changes 12
Shows the require() error for unsupported directory imports.
Watch mode keeps running when the last test file is removed.
The detection window for --exit is widened.
Mocha works around ERR_PACKAGE_PATH_NOT_EXPORTED using find-up-simple.
The spec file path is propagated when a parallel worker dies.
A reporter option specified on the CLI takes precedence over the value in the config file.
Existing directories are watched so the first run starts armed.
Unknown configuration values are no longer treated as test specs.
Only positional arguments that are entirely numeric are rejected.
Embedded stacks render once after splitting err.stack at the trailing frame block.
Fixes parsing of negative numbers and quoted strings.
Preserves FIFO descriptors when respawning.
mocha 114 changes
New APIs and options 1
Adds an option to report skipped tests as failed.
Fixes and other changes 3
Mocha now surfaces ts-node compile errors so developers can see failures when compiling tests.
Fixed describe().timeout() so it works.
Mocha swallows more require errors from TypeScript files.