mocha-skill

mocha-skill is a skill for Claude Code, Codex from LambdaTest/agent-skills. It costs 67 tokens per session (832 once invoked), scanned A, original, MIT.

A helper for writing Mocha tests in JavaScript. Mocha runs test cases, Chai checks expected results, and Sinon replaces or observes dependencies during tests.

In plain words
What is it for?
Use it to generate JavaScript unit tests, setup and cleanup hooks, error checks, asynchronous tests, and tests with Sinon stubs or mocks.
Why use it?
It provides ready-made patterns for assertions, asynchronous code, and isolated tests that do not need to call real services.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to generate JavaScript unit tests, setup and cleanup hooks, error checks, asynchronous tests, and tests with Sinon stubs or mocks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lambdatest/agent-skills/mocha-skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LambdaTest/agent-skills --skill mocha-skill
Clone the repo
git clone --depth 1 https://github.com/LambdaTest/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mocha-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/lambdatest/agent-skills/mocha-skill/github.svg)](https://agentmods.dev/skills/lambdatest/agent-skills/mocha-skill)
Your own site
<a href="https://agentmods.dev/skills/lambdatest/agent-skills/mocha-skill"><img src="https://agentmods.dev/badge/skills/lambdatest/agent-skills/mocha-skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mocha-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/lambdatest/agent-skills/mocha-skill"><img src="https://agentmods.dev/badge/skills/lambdatest/agent-skills/mocha-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 832 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 5 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 99
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 100
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 101
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 102
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 103
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00067 $0.00832
Opus 5.5 $0.00027 $0.00333
Sonnet 5.5 $0.00013 $0.00166
Haiku 4.5 $0.00007 $0.00083

Measured 3mo ago against content hash 92f59d46e4b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mocha-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

mocha-skill/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mocha Testing Skill

Core Patterns

Basic Test with Chai

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

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

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

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
Missing done() Use async/await Hanging tests
No sandbox sinon.createSandbox() Stubs leak
Arrow in describe Regular function for this.timeout() Context

Quick Reference

Task Command
Run all npx mocha
Watch npx mocha --watch
Grep npx mocha --grep "login"
Timeout npx mocha --timeout 10000
Recursive npx mocha --recursive

Setup: npm install mocha chai sinon --save-dev

Deep Patterns → reference/playbook.md

Read the full file on GitHub · 121 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 121 lines · 67 tokens per session scan A 92f59d46e4b2

Subscribe to this mod's changes

mocha-skill is a skill published in the GitHub repository LambdaTest/agent-skills (398 stars, last pushed 14d ago), licensed MIT. It adds 67 tokens to every session and 832 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

mocha-skill compared with skills from other repositories

mocha-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mocha-skillLambdaTest/agent-skillsSkill39814d agoMITA67Claude Code, Codex
rust-testingaffaan-m/ECCSkill314kyesterdayMITA31Claude Code, Kiro
golang-testingaffaan-m/ECCSkill314kyesterdayMITA37Claude Code, Kiro
java-affected-testsopen-metadata/OpenMetadataSkill16ktodayApache-2.0A120Claude Code
migrate-xunit-to-xunit-v3dotnet/skillsSkill6.4ktodayMITA149Claude Code
golang-testingsamber/cc-skills-golangSkill4.0k22d agoMITA115Claude Code
adk-setupgoogle/adk-pythonSkill22ktodayApache-2.0C146Claude Code