Setup & Installation
What This Skill Does
Generates Mocha test files with Chai assertions and Sinon stubs and spies. Covers async patterns, sandbox setup, and common anti-patterns for JavaScript and TypeScript projects.
Mocha's flexibility means lots of boilerplate decisions around assertion style, mocking setup, and sandbox cleanup. This skill handles those defaults so you write tests instead of config.
When to use it
- Writing describe/it blocks with Chai expect assertions
- Stubbing API calls with Sinon sandboxes in unit tests
- Testing async functions with await or callback patterns
- Setting up Mocha config with coverage and TypeScript support
- Adding Express route tests with Supertest integration