Mocha

December 4, 2025 ยท View on GitHub

Mocha is supported as a testing framework. It will be auto-detected if available.

Setup

Include this as your first file before including other tests:

mocha ./node_modules/console-fail-test/lib/setup.js src/**/*.test.js

Alternately, if you have a setup file already being run first, or you'd like to manually enable this in individual files, you can use the Node API:

// some.test.js

require("console-fail-test").cft();