Mocha Skill
Generates Mocha tests in JavaScript with Chai assertions and Sinon mocking. Use when user mentions "Mocha", "Chai", "sinon", "describe/it (not Jest)". Triggers on: "Mocha", "Chai", "sinon", "mocha test".
Install
npx skills add LambdaTest/agent-skills --skill mocha-skillgit clone --depth 1 https://github.com/LambdaTest/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/mocha-skill ~/.claude/skills/mocha-skillPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Mocha Testing Skill
## Core Patterns
### Basic Test with Chai
```javascript
const { expect } = require('chai');
describe('Calculator', () => {
let calc;
beforeEach(() => { calc = new Calculator(); });
it('should add two numbers', () => {
expect(calc.add(2, 3)).to.equal(5);
});
it('should throw on divide by zero', () => {
expect(() => calc.divide(10, 0)).to.throw('Division by zero');
});
});
```
### Chai Assertions
```javascript
expect(value).to.equal(5);
expect(arr).to.have.lengthOf(3);
expect(obj).to.have.property('name');
expect(str).to.include('hello');
expect(fn).to.throw(Error);
expect(arr).to.deep.equal([1, 2, 3]);
expect(obj).to.deep.include({ name: 'Alice' });
```
### Sinon Mocking
```javascript
const sinon = require('sinon');
describe('UserService', () => {
let sandbox;
beforeEach(() => { sandbox = sinon.createSandbox(); });
afterEach(() => { sandbox.restore(); });
it('fetches user from API', async () => {
const stub = sandbox.stub(api, 'get').resolves({ name: 'Alice' });
const user = await userService.getUser(1);
expect(user.name).to.equal('Alice');
expect(stub.calledOnce).to.be.true;
});
});
```
### Async Testing
```javascript
it('should fetch data', async () => {
const data = await fetchData();
expect(data).to.have.property('id');
});
it('callback style', (done) => {
fetchData((err, data) => {
expect(err).to.be.null;
done();
});
});
```
### Anti-Patterns
| Bad | Good | Why |Details
- Skill name
mocha-skill- Repository
- LambdaTest/agent-skills
- Path
mocha-skill/SKILL.md- License
- MIT
- Repo updated
- 30 October 2026
- Listed in
- VoltAgent/awesome-agent-skills
FAQ
What does the Mocha Skill skill do?
Generates Mocha tests in JavaScript with Chai assertions and Sinon mocking. Use when user mentions "Mocha", "Chai", "sinon", "describe/it (not Jest)". Triggers on: "Mocha", "Chai", "sinon", "mocha test".
How do I install the Mocha Skill skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add LambdaTest/agent-skills --skill mocha-skill. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Mocha Skill popular?
It lives in LambdaTest/agent-skills, which has 386 GitHub stars and 76 forks, and is included in 1 curated skill list.
Related skills
Appium Skill
386LambdaTest/agent-skills
Generates production-grade Appium mobile automation scripts for Android and iOS in Java, Python, or JavaScript. Supports real device and emulator testing locally and on TestMu AI cloud with 100+ real devices. Use when the user asks to automate mobile apps, test on Android/iOS, write Appium tests, or mentions "Appium", "mobile testing", "real device", "app automation". Triggers on: "Appium", "mobile test", "Android test", "iOS test", "real device", "app automation", "UiAutomator", "XCUITest driver", "TestMu", "LambdaTest".
Behat Skill
386LambdaTest/agent-skills
Generates Behat BDD tests for PHP with Gherkin feature files and MinkContext for browser testing. Use when user mentions "Behat", "PHP BDD", "Mink", "behat.yml". Triggers on: "Behat", "PHP BDD", "Mink", "behat.yml", "FeatureContext PHP".
Behave Skill
386LambdaTest/agent-skills
Generates Behave BDD tests for Python with Gherkin feature files and step implementations. Use when user mentions "Behave", "Python BDD", "Python Gherkin". Triggers on: "Behave", "Python BDD", "behave test", "Python feature file".
Mstest Skill
386LambdaTest/agent-skills
Generates MSTest tests in C#. Microsoft's built-in testing framework for .NET. Use when user mentions "MSTest", "[TestMethod]", "[TestClass]", "Assert.AreEqual". Triggers on: "MSTest", "[TestMethod]", "[TestClass]", "Microsoft test framework".
Lettuce Skill
386LambdaTest/agent-skills
Generates Lettuce BDD tests for Python with feature files and step definitions. Note: Lettuce is legacy/unmaintained; consider Behave for new projects. Use when user specifically mentions "Lettuce". Triggers on: "Lettuce", "lettuce test", "lettuce BDD".
Nemojs Skill
386LambdaTest/agent-skills
Generates Nemo.js automation tests in JavaScript. PayPal's Selenium-based test framework for Node.js. Use when user mentions "Nemo.js", "nemo automation". Triggers on: "Nemo.js", "nemo automation", "nemo test", "PayPal test framework".
Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.