# jest-testing

This skill guides Jest testing for Node.js, from unit checks to API tests with Supertest. Use it when you need examples for mocks, coverage reports, or CI runs.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 121 installs · ★ 2 repo stars
- Author: pluginagentmarketplace
- License: LicenseRef-Proprietary · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pluginagentmarketplace/custom-plugin-nodejs/tree/HEAD/skills/jest-testing/SKILL.md
- Updated: 2026-01-07
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/jest-testing

## What it does

The skill covers Jest test structure, synchronous and asynchronous code, module and function mocks, fake timers, and test lifecycle hooks. Its Supertest examples exercise API requests, including successful responses and error cases.

It also walks through Jest settings in `package.json`, coverage reports, and running tests in GitHub Actions. The examples use `npm test` and `npm test -- --coverage`. API test examples depend on Supertest, and the skill’s setup calls for installing `jest` and `supertest` as development dependencies. Without those packages, the API testing examples will not run.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jest-testing -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/jest-testing/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/jest-testing/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jest-testing -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/jest-testing/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jest-testing -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/jest-testing/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pluginagentmarketplace/custom-plugin-nodejs skills/jest-testing
```

2. **Manually: put the files in place**
- File: `.github/skills/jest-testing/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jest-testing -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pluginagentmarketplace/custom-plugin-nodejs --path skills/jest-testing
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/jest-testing/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pluginagentmarketplace/custom-plugin-nodejs --skill jest-testing -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pluginagentmarketplace/custom-plugin-nodejs/tree/HEAD/skills/jest-testing/SKILL.md

## When to use it
- write unit tests for Node.js functions
- check async code and error handling
- mock a module or function in a test
- exercise an API with Supertest
- generate a code coverage report

## Example prompts
- Help me write Jest tests for a user service, including the duplicate-email error case.
- Create Supertest API tests for the route that creates a user.
- Set up Jest tests with a coverage report in GitHub Actions.

## Similar
- [integration-testing](https://affpapa.org/en/nevibecode/skills/integration-testing.md) — skill · 564 installs
- [api-testing](https://affpapa.org/en/nevibecode/skills/oakoss-api-testing.md) — skill · 149 installs
- [nestjs-testing](https://affpapa.org/en/nevibecode/rules/nestjs-testing.md) — rule · ★ 372 repo stars
- [jest-react-testing](https://affpapa.org/en/nevibecode/skills/jest-react-testing.md) — skill · 1200 installs
- [jest-unit-testing-cursorrules-prompt-file](https://affpapa.org/en/nevibecode/rules/jest-unit-testing-cursorrules-prompt-file.md) — rule · ★ 41178 repo stars
- [jest-testing-expert](https://affpapa.org/en/nevibecode/agents/jest-testing-expert.md) — subagent · ★ 763 repo stars

From the same set: [pluginagentmarketplace/custom-plugin-nodejs](https://affpapa.org/en/nevibecode/by/pluginagentmarketplace/custom-plugin-nodejs.md) — 5 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
