msw
SolidMock Service Worker API mocking, request handlers, and integration testing.
AI & Automation 1,160 stars
71 forks Updated today MIT
Install
Quality Score: 94/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# 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
Details
- Author
- a5c-ai
- Repository
- a5c-ai/babysitter
- Created
- 4 months ago
- Last Updated
- today
- Language
- JavaScript
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
Testing & QA Solid
sdk-mock-generator
Generate mock servers and clients for SDK testing
1,160 Updated today
a5c-ai API & Backend Solid
api-mock-server
Generate and run mock API servers from OpenAPI specifications
1,160 Updated today
a5c-ai AI & Automation Featured
mocking-apis
Generate mock API servers for testing and development with realistic response data. Use when creating mock APIs for development and testing. Trigger with phrases like "create mock API", "generate API mock", or "setup mock server".
2,274 Updated today
jeremylongshore Testing & QA Listed
typescript-testing
TypeScript testing patterns with Vitest and MSW. Use when writing unit tests, mocking APIs, creating typed mocks for dependency injection, or using snapshot testing.
28 Updated 1 weeks ago
martinffx Testing & QA Listed
mock-server
Create and manage mock API servers for development and testing.
335 Updated today
aiskillstore