Skip to content

Upgrade msw-storybook-addon to v3 and msw to 2.15.0 - #1230

Draft
dgee2 wants to merge 1 commit into
deps-jsdom-majorfrom
deps-msw-storybook-addon-major
Draft

Upgrade msw-storybook-addon to v3 and msw to 2.15.0#1230
dgee2 wants to merge 1 commit into
deps-jsdom-majorfrom
deps-msw-storybook-addon-major

Conversation

@dgee2

@dgee2 dgee2 commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Bumps msw-storybook-addon 2.0.6 -> 3.0.0 and msw 2.12.14 -> 2.15.0
(these move together; msw-storybook-addon@2.0.6 is incompatible with
msw's newer worker internals, which is why Group 1 pinned msw down
via a pnpm override). Removes that override now that the addon
supports current msw.

msw-storybook-addon v3 removes initialize()/mswLoader in favor of
a definePreview-style addons: [addonMsw(setupFn)] call, and drops
parameters.msw support for CSF Next (this project's story format)
in favor of a beforeEach({ msw }) { msw.use(handler) } hook per
story. Updated .storybook/preview.ts and the three story files that
registered handlers accordingly.

This also surfaced and fixed two pre-existing, MSW-adjacent problems
that AGENTS.md had documented as "not currently reliable":

  • MSW genuinely wasn't intercepting requests under
    vitest --project=storybook before (confirmed by probing — a
    stricter assertion against a previously "passing" story failed
    until the beforeEach migration). It works correctly now; updated
    AGENTS.md's component-testing guidance to match and removed the
    workaround comments in the affected story files.
  • .storybook/msw-handlers.ts's recipe list fixtures used name
    instead of the real API's title field, which had gone unnoticed
    because MSW wasn't actually serving the response before.

Verified: lint, build, unit tests (57/57), storybook interaction
tests (78/78, now genuinely exercising mocked responses rather than
incidentally matching a fallback UI state), and a dev-server smoke
check. Playwright e2e (pnpm run test:e2e) fails, but on an
unrelated pre-existing stale scaffold assertion ("You did it!") that
doesn't match this app's actual content and is unmodified from main.

Co-authored-by: Claude noreply@anthropic.com


Stack created with GitHub Stacks CLIGive Feedback 💬

Bumps msw-storybook-addon 2.0.6 -> 3.0.0 and msw 2.12.14 -> 2.15.0
(these move together; msw-storybook-addon@2.0.6 is incompatible with
msw's newer worker internals, which is why Group 1 pinned msw down
via a pnpm override). Removes that override now that the addon
supports current msw.

msw-storybook-addon v3 removes `initialize()`/`mswLoader` in favor of
a `definePreview`-style `addons: [addonMsw(setupFn)]` call, and drops
`parameters.msw` support for CSF Next (this project's story format)
in favor of a `beforeEach({ msw }) { msw.use(handler) }` hook per
story. Updated .storybook/preview.ts and the three story files that
registered handlers accordingly.

This also surfaced and fixed two pre-existing, MSW-adjacent problems
that AGENTS.md had documented as "not currently reliable":
- MSW genuinely wasn't intercepting requests under
  `vitest --project=storybook` before (confirmed by probing — a
  stricter assertion against a previously "passing" story failed
  until the beforeEach migration). It works correctly now; updated
  AGENTS.md's component-testing guidance to match and removed the
  workaround comments in the affected story files.
- .storybook/msw-handlers.ts's recipe list fixtures used `name`
  instead of the real API's `title` field, which had gone unnoticed
  because MSW wasn't actually serving the response before.

Verified: lint, build, unit tests (57/57), storybook interaction
tests (78/78, now genuinely exercising mocked responses rather than
incidentally matching a fallback UI state), and a dev-server smoke
check. Playwright e2e (`pnpm run test:e2e`) fails, but on an
unrelated pre-existing stale scaffold assertion ("You did it!") that
doesn't match this app's actual content and is unmodified from main.

Co-authored-by: Claude <noreply@anthropic.com>
@dgee2
dgee2 force-pushed the deps-msw-storybook-addon-major branch from 7f9db45 to 3e67f50 Compare August 13, 2026 21:45
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant