4,953,369 AI resources indexedWorking toward the world’s largest AI resource index.

Testing Sub-Skill

Unit testing for Express + Prisma modules. Scaffolds __tests__/ on module creation, generates domain-specific test cases, deep-reviews and fills gaps in existing tests. Trigger for: "create tests", "add missing tests", "review tests", "setup vitest", "add unit tests", or when a new module is scaf...

Installable skillMITBy raihansharifrimonUpdated Oct 31, 2026
INTENDED FOROpenClawInstall in a listed agent.

instructions.md

---
name: testing-7e95ba89a094
description: >
  Unit testing for Express + Prisma modules. Scaffolds __tests__/ on module creation,
  generates domain-specific test cases, deep-reviews and fills gaps in existing tests.
  Trigger for: "create tests", "add missing tests", "review tests", "setup vitest",
  "add unit tests", or when a new module is scaffolded.
---

# Testing Sub-Skill

Reads: `../../references/project.config.md` · `../../references/conventions.md`

## Detect Test Tool
Check `apps/api/package.json`: vitest → Vitest | jest → Jest | neither → load `references/setup.md`

## Task Router
| Task | Action |
|---|---|
| Module just scaffolded | Create `__tests__/` skeleton only |
| "create tests for [module]" | Read source → generate full test cases |
| "review" / "add missing tests" | Deep review → print audit → fill gaps |
| "setup testing" / no tool found | `references/setup.md` |

## Output Per Module
```
src/{resources}/__tests__/
├── {rs}.service.test.ts    ← unit (mock repo only)
└── {r}.dto.test.ts         ← Zod edge cases
```
Skip: controllers, routes (E2E), repository (integration in `packages/database`).

## Review Protocol
1. Read source files + existing tests
2. Print audit before writing anything:
```
📋 {Resource} Tests
findAll{R}s  {✅|⚠️|❌}  find{R}ById  {✅|⚠️|❌}
create{R}    {✅|⚠️|❌}  update{R}    {✅|⚠️|❌}
remove{R}    {✅|⚠️|❌}  dto:create   {✅|⚠️|❌}  dto:update {✅|⚠️|❌}
⚠️ = exists but: {issue}  |  action: {what will be added/fixed}
```
3. Add only missing/broken — never rewrite passing tests

## Rules
- Descriptions domain-specific: `'returns null when project not found'` not `'works'`
- Arrange → Act → Assert only, no over-engineering
- Mock repository only, never the service
- `vi.clearAllMocks()` in every `beforeEach`
- No shared fixtures unless reused 3+ times

## Templates
`references/templates.md` · `references/setup.md`

Platform guidance

Imported from the listed AgentSkill.sh category. Complete supplied package files and notices are retained. Required external tools and credentials are not installed. No bundled code was executed during import. Individual agent task behavior has not been tested.