Every premium and members-only resource for $9.99/month, as a no-commitment subscription. See the plans

PalateKit

Menu

Request a resource

Describe the resource you are missing in one sentence. We will email you when it is published.

0 / 280

Unlock PalateKit

Unlock everything

Plan

Paying means accepting our terms of sale.

Secure payment by Stripe. Receipts and invoices sent by email.

Welcome back

Sign in to install, download or save this resource. A free account is enough for free resources.

API mocking with MSW 2 for tests v1.0.0

Use this resource to mock REST or GraphQL APIs with MSW 2 in tests

New

  • 501 downloads
  • 146 likes
  • 176 saves

Free

Install with the CLI

In a terminal, from the folder you want:

npx --yes palatekit@latest install msw-api-mocking-tests-2

With no option, the skill goes to ~/.agents/skills/; add --agent claude-code (or codex, cursor…) to target an agent.

First time: connect the CLI with

npx --yes palatekit@latest login

The agent configures MSW, writes the handlers and how they are organized, then wires the mock into tests and error cases. It also helps debug handlers that do not match requests.

Mostly picked by

Updated November 2, 2026

Card for the “API mocking with MSW 2 for tests” skill

Details

Generates with
Your agent's model
Licence
MIT

Similar resources

View all

What you get

  • SKILL.md: prioritized best practices and quick reference table
  • references/: dynamic scenarios, cookies, file uploads, Playwright, WebSocket and debugging

Good fit for

  • Your tests depend on a live API and are flaky
  • You want to test a request's error states without changing the code

Not for

    Tags

    • msw
    • mock
    • tests
    • api

    About

    You say

    “Create an MSW handler that returns a 500 on /api/payments, to test the error display of my form.”

    Card for the “API mocking with MSW 2 for tests” skill

    Skill published by pymodel under the MIT license, delivered in its original version.

    Show more

    How to use it

    1. Install the skill in your agent's skills folder
    2. Ask your agent to mock REST or GraphQL APIs with MSW 2 in tests
    3. Review and adjust the result

    Content preview

    Files

    • LICENSE1.1 KB
    • NOTICE-PALATEKIT.md0.4 KB
    • references/advanced-bypass-requests.md2.3 KB
    • references/advanced-cookies-auth.md2.9 KB
    • references/advanced-dynamic-scenarios.md2.9 KB
    • references/advanced-file-uploads.md2.9 KB
    • references/advanced-playwright-integration.md2.9 KB
    • references/advanced-vitest-browser.md2.4 KB
    • references/advanced-websocket-mocking.md2.6 KB
    • references/debug-common-issues.md2.1 KB
    • references/debug-lifecycle-events.md2.4 KB
    • references/debug-request-logging.md3.1 KB
    • references/debug-verify-interception.md2.6 KB
    • references/graphql-batched-queries.md2.6 KB
    • references/graphql-error-responses.md2.8 KB
    • references/graphql-operation-handlers.md2.4 KB
    • references/graphql-schema-first.md2.4 KB
    • references/graphql-variables-access.md3 KB
    • references/handler-absolute-urls.md1.9 KB
    • references/handler-domain-grouping.md2.4 KB
    • references/handler-happy-path-first.md2 KB
    • references/handler-request-body-parsing.md2.1 KB
    • references/handler-resolver-argument.md2.3 KB
    • references/handler-reusability-environments.md2.3 KB
    • references/handler-shared-resolvers.md2.7 KB
    • references/handler-v2-response-syntax.md2.1 KB
    • references/match-custom-predicate.md2.5 KB
    • references/match-handler-order.md2.5 KB
    • references/match-http-methods.md2.7 KB
    • references/match-query-params.md2.6 KB
    • references/match-url-patterns.md2.2 KB
    • references/response-custom-headers.md2.9 KB
    • references/response-delay-realistic.md2.7 KB
    • references/response-error-simulation.md2.6 KB
    • references/response-http-response-helpers.md2.3 KB
    • references/response-one-time-handlers.md2.8 KB
    • references/response-streaming.md3.1 KB
    • references/setup-lifecycle-hooks.md1.7 KB
    • references/setup-node-version.md1.4 KB
    • references/setup-server-node-entrypoint.md1.3 KB
    • references/setup-typescript-config.md1.8 KB
    • references/setup-unhandled-requests.md2 KB
    • references/setup-worker-script-commit.md1.6 KB
    • references/test-async-utilities.md2.3 KB
    • references/test-avoid-request-assertions.md2.6 KB
    • references/test-clear-request-cache.md2.3 KB
    • references/test-concurrent-boundary.md2.5 KB
    • references/test-fake-timers-config.md2.2 KB
    • references/test-jsdom-environment.md1.8 KB
    • references/test-reset-handlers.md1.8 KB
    • SKILL.md5.2 KB

    Origin and licence

    Listed unmodified

    Author
    pymodel
    Source
    github.com/pymodel/react-frontend-skills/tree/b210600fdf49441ee1efeca2cbdc05599ec03019/skills/msw
    Licence
    MIT

    Notice

    « msw » (pymodel, MIT) livré dans sa version d'origine : fiche en français et en anglais par PalateKit.

    User reviews

    –

    No ratings yet

    Loading reviews…

    Delete your review?

    Your rating and comment will be removed from the page.