·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

暫無