Skip to content
Back to skills

Msw

ASecurity

Mock Service Worker API mocking, request handlers, and integration testing.

  • 1,760 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentstypescriptbashreactnodetestingapifrontend

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 2, 2026

npx -y skills add a5c-ai/babysitter --skill msw --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Msw?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Msw
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a5c-ai-msw-babysitter/badge)](https://www.skillsdirectory.com/skills/a5c-ai-msw-babysitter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: msw
description: Mock Service Worker API mocking, request handlers, and integration testing.
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
graph:
  domains: [domain:web-development]
  specializations: [specialization:web-development]
  skillAreas: [skill-area:react-testing, skill-area:service-mocking]
  roles: [role:frontend-engineer, role:qa-engineer]
  topics: [topic:test-driven-development]

---

# MSW Skill

Expert assistance for API mocking with Mock Service Worker.

## Capabilities

- Create request handlers
- Mock REST and GraphQL APIs
- Handle network errors
- Integrate with tests
- Use in development

## Handlers

```typescript
import { http, HttpResponse } from 'msw';

export const handlers = [
  http.get('/api/users', () => {
    return HttpResponse.json([
      { id: '1', name: 'John' },
      { id: '2', name: 'Jane' },
    ]);
  }),

  http.post('/api/users', async ({ request }) => {
    const body = await request.json();
    return HttpResponse.json({ id: '3', ...body }, { status: 201 });
  }),

  http.get('/api/users/:id', ({ params }) => {
    return HttpResponse.json({ id: params.id, name: 'John' });
  }),
];
```

## Test Integration

```typescript
import { setupServer } from 'msw/node';
import { handlers } from './handlers';

const server = setupServer(...handlers);

beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());
```

## Target Processes

- api-mocking
- integration-testing
- frontend-development

Files in this skill

  • README.md362 B
  • SKILL.md1.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.