mocha
Installation
SKILL.md
Mocha
Mocha is a flexible JavaScript test framework. Unlike Jest, it does not come with an assertion library, mocking, or snapshotting built-in. It is a runner that allows you to choose your own tools (usually Chai + Sinon).
When to Use
- Flexibility: You want to pick your assertion library (Chai, Should.js).
- Node.js Backends: standard in many Express/NestJS (legacy) setups.
- Asynchronous Testing: Historically strong support for async (though standard now).
Quick Start
// npm install --save-dev mocha chai
const assert = require("chai").assert;