Mocha

Simple, flexible, fun — JavaScript test framework running on Node.js and browser.

Language: JS/TSCategory: TestingFirst released: 2011Created by: TJ HolowaychukLicense: MIT

Mocha is a feature-rich JavaScript test framework that runs on Node.js and in the browser, making asynchronous testing straightforward and enjoyable. It provides a flexible API supporting both BDD-style (describe, it, before, after) and TDD-style (suite, test, setup, teardown) interfaces, allowing teams to choose the convention that fits their workflow. Mocha is fully decoupled from assertion libraries, working seamlessly with Chai, expect.js, should.js, or Node.js assert. Its reporter system includes built-in spec, dot, nyancat, and JSON reporters, with a plugin architecture enabling custom formatters. Support for test retries, global timeouts, root-level hooks, and parallel mode gives teams the tools needed for reliable CI/CD pipelines.

Links

Key Features

Async test supportTDD and BDD interfacesFlexible reportersBrowser supportTest retriesGlobal timeoutRoot hook plugin systemParallel mode