# Mern Unit Test

> Run MERN unit tests, report results, and optionally fix failures.

- Skill: `majiayu000/mern-unit-test` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/mern-unit-test`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/mern-unit-test/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/mern-unit-test

---


## Purpose

Run unit tests, report failures with enough detail to debug, then (with approval) fix issues and re-run to confirm.

## Arguments

- `--scope <target>` — Limit to `apps/web`, `packages/shared`, or `all` (default: all)
- `--no-fix` — Report only, don't offer to fix

## Workflow

### 1. Run tests

```bash
# All tests
pnpm test

# With coverage (if configured)
pnpm test -- --coverage

# Scoped
pnpm -C apps/web test
pnpm -C packages/shared test
```

### 2. Report results

Include:

- Pass/fail/skip counts
- Coverage summary (if available)
- Each failing test: file, test name, assertion diff or error
- If coverage not configured, note this and offer to set it up

### 3–4. Approval gate, fix and confirm

See `/shared-review-workflow` for approval gate protocol, fix constraints, and severity definitions.

## Reference

For coverage setup and common fix patterns, see `reference/mern-unit-test-reference.md`

