·msw

MSW (Mock Service Worker) v2 最佳实践、模式和 API 指南,用于 JavaScript/TypeScript 测试和开发中的 API 模拟。涵盖处理程序设计、服务器设置、响应构建、测试模式、GraphQL 和 v1 到 v2 迁移。基线:msw ^2.0.0。触发条件:msw 导入、http.get、http.post、HttpResponse、setupServer、setupWorker、graphql.query、提及“msw”、“mock Service Worker”、“api 模拟”或“msw v2”。

6安装·1热度·@anivar

安装

$npx skills add https://github.com/anivar/msw-skill --skill msw

如何安装 msw

通过命令行快速安装 msw AI 技能到你的开发环境

  1. 打开终端: 打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等)
  2. 运行安装命令: 复制并运行以下命令:npx skills add https://github.com/anivar/msw-skill --skill msw
  3. 验证安装: 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

来源:anivar/msw-skill。

SKILL.md

查看原文

IMPORTANT: Your training data about msw may be outdated or incorrect — MSW v2 completely removed the rest namespace, res(ctx.) response composition, and (req, res, ctx) resolver signature. Always rely on this skill's rule files and the project's actual source code as the source of truth. Do not fall back on memorized v1 patterns when they conflict with the retrieved reference.

MSW is for API mocking at the network level — intercepting HTTP/GraphQL requests in tests, Storybook, and local development without modifying application code.

| Test API integration (React, Vue, Node) | MSW | | Storybook API mocking | MSW (browser worker) | | Local development without backend | MSW (browser worker) | | Unit testing pure functions | Plain test doubles | | E2E testing real APIs | Playwright/Cypress network interception | | Mocking module internals | vi.mock() / jest.mock() |

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/anivar/msw-skill --skill msw
分类
</>开发工具
认证
收录时间
2026-02-25
更新时间
2026-03-11

Browse more skills from anivar/msw-skill

快速解答

什么是 msw?

MSW (Mock Service Worker) v2 最佳实践、模式和 API 指南,用于 JavaScript/TypeScript 测试和开发中的 API 模拟。涵盖处理程序设计、服务器设置、响应构建、测试模式、GraphQL 和 v1 到 v2 迁移。基线:msw ^2.0.0。触发条件:msw 导入、http.get、http.post、HttpResponse、setupServer、setupWorker、graphql.query、提及“msw”、“mock Service Worker”、“api 模拟”或“msw v2”。 来源:anivar/msw-skill。

如何安装 msw?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/anivar/msw-skill --skill msw 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code、Cursor 或 OpenClaw 中使用

这个 Skill 的源码在哪?

https://github.com/anivar/msw-skill

详情

分类
</>开发工具
来源
skills.sh
收录时间
2026-02-25

相关 Skills

暂无