testing-with-api-mocks — ai-security testing-with-api-mocks, toolhive-studio, community, ai-security, ide skills, continue, copilot, developer-tools, mcp-client, model-context-protocol

v1.0.0

이 스킬 정보

MSW를 사용한 자동 API 모킹을 통한 효율적인 테스트가 필요한 AI 에이전트에게 적합 Start here for all API mocking in tests. Covers auto-generation, fixtures, and when to use other skills. Required reading before creating, refactoring, or modifying any test involving API calls.

# Core Topics

stacklok stacklok
[116]
[13]
Updated: 3/3/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 7/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
7/11
Quality Score
49
Canonical Locale
en
Detected Body Locale
en

MSW를 사용한 자동 API 모킹을 통한 효율적인 테스트가 필요한 AI 에이전트에게 적합 Start here for all API mocking in tests. Covers auto-generation, fixtures, and when to use other skills. Required reading before creating, refactoring, or modifying any test involving API calls.

이 스킬을 사용하는 이유

MSW를 사용하여 자동 생성된 스키마 기반의 모킹을 생성함으로써 MCP 서버와 ToolHive 애플리케이션의 개발 프로세스를 간소화하고 API 엔드포인트의 효율적인 테스트를 가능하게 하며 개발 시간을 단축하는 에이전트의 능력을 부여

최적의 용도

MSW를 사용한 자동 API 모킹을 통한 효율적인 테스트가 필요한 AI 에이전트에게 적합

실행 가능한 사용 사례 for testing-with-api-mocks

테스트를 위한 API 모킹의 자동화
MCP 서버의 개발 프로세스 간소화
자동 생성된 모킹을 사용한 ToolHive 애플리케이션의 효율적인 테스트

! 보안 및 제한 사항

  • MSW(모의 서비스 워커) 설정이 필요
  • 既存의 스키마를 갖는 API 엔드포인트에만 제한

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Curated Collection Review

Reviewed In Curated Collections

This section shows how Killer-Skills has already collected, reviewed, and maintained this skill inside first-party curated paths. For operators and crawlers alike, this is a stronger signal than treating the upstream README as the primary story.

Reviewed Collection

AI 에이전트 개발을 위한 핵심 개발 도구 | AI Agent Skills

Reviewed 2026-04-17

Reviewed on 2026-04-17 against coding workflow fit, installation clarity, review and testing value, and release guardrails. This page is now positioned as an install-first developer workflow entry point instead of a vague tooling roundup.

We prioritize this page because developer-intent users usually need one toolchain they can install, validate, and prove inside a real coding loop before they standardize it across the team.

12 entries Killer-Skills editorial review within the recovery-focused authority queue.
Reviewed Collection

개발 워크플로우를 위한 TypeScript AI 도구 모음 | AI Agent Skills

Reviewed 2026-04-17

Reviewed on 2026-04-17 against TypeScript workflow fit, installation clarity, operator handoff, and day-to-day product engineering usefulness. This page is now positioned as an install-first TypeScript entry point instead of a broad language roundup.

We prioritize this page because TypeScript-intent users usually need a shortlist they can install, validate, and carry into real typed delivery loops quickly.

12 entries Killer-Skills editorial review within the recovery-focused authority queue.
Reviewed Collection

Cursor 호환 스킬 & 워크플로우 연동 | AI Agent Skills

Reviewed 2026-04-17

Reviewed on 2026-04-17 for setup clarity, maintainer reliability, refactor support, and handoff readiness. We kept the tools that help Cursor teams move from fast local wins to repeatable team habits.

People landing here usually already code in Cursor. What they need next is a smaller list tied to refactors, review, tests, rules sync, and handoff instead of another generic integrations page.

9 entries Killer-Skills editorial review with monthly collection checks.
After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is testing-with-api-mocks?

MSW를 사용한 자동 API 모킹을 통한 효율적인 테스트가 필요한 AI 에이전트에게 적합 Start here for all API mocking in tests. Covers auto-generation, fixtures, and when to use other skills. Required reading before creating, refactoring, or modifying any test involving API calls.

How do I install testing-with-api-mocks?

Run the command: npx killer-skills add stacklok/toolhive-studio. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for testing-with-api-mocks?

Key use cases include: 테스트를 위한 API 모킹의 자동화, MCP 서버의 개발 프로세스 간소화, 자동 생성된 모킹을 사용한 ToolHive 애플리케이션의 효율적인 테스트.

Which IDEs are compatible with testing-with-api-mocks?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for testing-with-api-mocks?

MSW(모의 서비스 워커) 설정이 필요. 既存의 스키마를 갖는 API 엔드포인트에만 제한.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add stacklok/toolhive-studio. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use testing-with-api-mocks immediately in the current project.

! Reference-Only Mode

This page remains useful for installation and reference, but Killer-Skills no longer treats it as a primary indexable landing page. Read the review above before relying on the upstream repository instructions.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

testing-with-api-mocks

Install testing-with-api-mocks, an AI agent skill for AI agent workflows and automation. Review the use cases, limitations, and setup path before rollout.

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Testing with API Mocks

This is the starting point for all API mocking in tests. Read this skill first before working on any test that involves API calls.

This project uses MSW (Mock Service Worker) with auto-generated schema-based mocks. When writing tests for code that calls API endpoints, mocks are created automatically.

How It Works

  1. Run a test that triggers an API call (e.g., a component that fetches data)
  2. Mock auto-generates if no fixture exists for that endpoint
  3. Fixture saved to renderer/src/common/mocks/fixtures/<endpoint>/<method>.ts
  4. Subsequent runs use the saved fixture

No manual mock setup is required for basic tests.

Fixture Location

Fixtures are organized by endpoint path and HTTP method:

renderer/src/common/mocks/fixtures/
├── groups/
│   ├── get.ts          # GET /api/v1beta/groups
│   └── post.ts         # POST /api/v1beta/groups
├── workloads/
│   └── get.ts          # GET /api/v1beta/workloads
├── workloads_name/
│   └── get.ts          # GET /api/v1beta/workloads/:name
└── ...

Path parameters like :name become _name in the directory name.

Fixture Structure

Generated fixtures use the AutoAPIMock wrapper with types from the OpenAPI schema:

typescript
1// renderer/src/common/mocks/fixtures/groups/get.ts 2import type { 3 GetApiV1BetaGroupsResponse, 4 GetApiV1BetaGroupsData, 5} from '@common/api/generated/types.gen' 6import { AutoAPIMock } from '@mocks' 7 8export const mockedGetApiV1BetaGroups = AutoAPIMock< 9 GetApiV1BetaGroupsResponse, 10 GetApiV1BetaGroupsData 11>({ 12 groups: [ 13 { name: 'default', registered_clients: ['client-a'] }, 14 { name: 'research', registered_clients: ['client-b'] }, 15 ], 16})

The second type parameter (*Data) provides typed access to request parameters (query, path, body) for conditional overrides.

Naming Convention

Export names follow the pattern: mocked + HTTP method + endpoint path in PascalCase.

  • GET /api/v1beta/groupsmockedGetApiV1BetaGroups
  • POST /api/v1beta/workloadsmockedPostApiV1BetaWorkloads
  • GET /api/v1beta/workloads/:namemockedGetApiV1BetaWorkloadsByName

Writing a Basic Test

For most tests, just render the component and the mock handles the rest:

typescript
1import { render, screen, waitFor } from '@testing-library/react' 2 3it('displays groups from the API', async () => { 4 render(<GroupsList />) 5 6 await waitFor(() => { 7 expect(screen.getByText('default')).toBeVisible() 8 }) 9})

The auto-generated mock provides realistic fake data based on the OpenAPI schema.

Customizing Fixture Data

If the auto-generated data doesn't suit your test, edit the fixture file directly:

typescript
1// renderer/src/common/mocks/fixtures/groups/get.ts 2export const mockedGetApiV1BetaGroups = AutoAPIMock< 3 GetApiV1BetaGroupsResponse, 4 GetApiV1BetaGroupsData 5>({ 6 groups: [ 7 { name: 'production', registered_clients: ['claude-code'] }, // Custom data 8 { name: 'staging', registered_clients: [] }, 9 ], 10})

This becomes the new default for all tests using this endpoint.

Regenerating a Fixture

To regenerate a fixture with fresh schema-based data:

  1. Delete the fixture file
  2. Run a test that calls that endpoint
  3. New fixture auto-generates
bash
1rm renderer/src/common/mocks/fixtures/groups/get.ts 2pnpm test -- --run <test-file>

Key Imports

typescript
1// Types for API responses and request parameters 2import type { 3 GetApiV1BetaGroupsResponse, 4 GetApiV1BetaGroupsData, 5} from '@common/api/generated/types.gen' 6 7// AutoAPIMock wrapper 8import { AutoAPIMock } from '@mocks' 9 10// Fixture mocks (for test-scoped overrides, see: testing-api-overrides skill) 11import { mockedGetApiV1BetaGroups } from '@mocks/fixtures/groups/get'

204 No Content Endpoints

For endpoints that return 204, create a minimal AutoAPIMock fixture and override the handler in each test:

typescript
1// renderer/src/common/mocks/fixtures/health/get.ts 2import type { 3 GetHealthResponse, 4 GetHealthData, 5} from '@common/api/generated/types.gen' 6import { AutoAPIMock } from '@mocks' 7 8export const mockedGetHealth = AutoAPIMock<GetHealthResponse, GetHealthData>( 9 '' as unknown as GetHealthResponse 10)

Then in tests, use .overrideHandler() to return the appropriate response:

typescript
1import { mockedGetHealth } from '@mocks/fixtures/health/get' 2import { HttpResponse } from 'msw' 3 4it('navigates on health check success', async () => { 5 mockedGetHealth.overrideHandler(() => new HttpResponse(null, { status: 204 })) 6 // ... 7}) 8 9it('handles health check failure', async () => { 10 mockedGetHealth.overrideHandler(() => HttpResponse.error()) 11 // ... 12})

Custom Mocks (Text/Plain Endpoints)

Custom mocks are only needed for text/plain endpoints. The only current example is the logs endpoint:

typescript
1// renderer/src/common/mocks/customHandlers/index.ts 2export const customHandlers = [ 3 http.get(mswEndpoint('/api/v1beta/workloads/:name/logs'), ({ params }) => { 4 const { name } = params 5 const logs = getMockLogs(name as string) 6 return new HttpResponse(logs, { status: 200 }) 7 }), 8]

To override the logs response in tests, use the exported getMockLogs mock:

typescript
1import { getMockLogs } from '@/common/mocks/customHandlers' 2 3getMockLogs.mockReturnValueOnce('Custom log content for this test')
  • testing-api-overrides - Test-scoped overrides and conditional responses for testing filters/params
  • testing-api-assertions - Verifying API calls for mutations (create/update/delete)

관련 스킬

Looking for an alternative to testing-with-api-mocks or another community skill for your workflow? Explore these related open-source skills.

모두 보기

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
인공지능

widget-generator

Logo of f
f

prompts.chat 피드 시스템을 위한 사용자 지정 가능한 위젯 플러그인을 생성합니다

149.6k
0
인공지능

flags

Logo of vercel
vercel

리액트 프레임워크

138.4k
0
브라우저

pr-review

Logo of pytorch
pytorch

파이썬에서 텐서와 동적 신경망 구현 및 강력한 GPU 가속 지원

98.6k
0
개발자