AgentSkillsCN

msw-setup

为测试与 Storybook 配置 MSW API Mocking 功能。

SKILL.md
--- frontmatter
name: msw-setup
description: Configure MSW for API mocking in tests and Storybook.
disable-model-invocation: true

MSW Setup

Add Mock Service Worker configuration for tests and stories.

When to Use

  • Use this skill when you need deterministic API mocks.

Inputs

  • API endpoints to mock
  • Target environments (tests, Storybook, dev)

Instructions

  1. Add MSW setup for tests.
  2. Define request handlers with typed responses.
  3. Document how to add new handlers.
  4. Add examples for Storybook if relevant.

Output

  • MSW configuration and example handlers.