Upgrade msw-storybook-addon to v3 and msw to 2.15.0 - #1230
Draft
dgee2 wants to merge 1 commit into
Draft
Conversation
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
force-pushed
the
deps-msw-storybook-addon-major
branch
from
August 13, 2026 21:45
7f9db45 to
3e67f50
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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()/mswLoaderin favor ofa
definePreview-styleaddons: [addonMsw(setupFn)]call, and dropsparameters.mswsupport for CSF Next (this project's story format)in favor of a
beforeEach({ msw }) { msw.use(handler) }hook perstory. 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":
vitest --project=storybookbefore (confirmed by probing — astricter 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.
nameinstead of the real API's
titlefield, which had gone unnoticedbecause 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 anunrelated 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 CLI • Give Feedback 💬