Skip to content

chore(deps-dev): Bump msw from 2.15.0 to 3.0.3 - #195

Open
dependabot[bot] wants to merge 2 commits into
mainfrom
dependabot/npm_and_yarn/msw-3.0.3
Open

dependabot[bot] wants to merge 2 commits into
mainfrom
dependabot/npm_and_yarn/msw-3.0.3

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Bumps msw from 2.15.0 to 3.0.3.

Release notes

Sourced from msw's releases.

v3.0.3 (2026-10-10)

Bug Fixes

  • HandlersController: dispose of reset handlers (#2810) (3818a81c455a638eda1558558d8ae3cd17a34e55) @​kettanaito
  • expose network context on enable in network sources (#2809) (d1fe8e6e6e7eefce43746ee44802bc553731e951) @​kettanaito

v3.0.2 (2026-10-03)

Bug Fixes

  • vite: support virtual:msw imports in vitest (#2802) (e73c381e3adc0848fcf9a7ef291b614b06a0d92b) @​kettanaito

v3.0.1 (2026-09-30)

Bug Fixes

  • treat CONNECT requests as the transport mechanism (#2796) (7cad86a03b0ddb2efdec96ce8a49b0ed07d9f4dc) @​kettanaito

v3.0.0 (2026-09-28)

⚠️ BREAKING CHANGES

  • MSW is now ESM-only (#2765).
  • Deprecate support for Node.js v18 and v20 (#2729). The minimal supported Node.js version is v22.
  • msw/native is removed in favor of @msw/react-native.
  • Require TypeScript 5.9 as the minimal version.
  • Deprecate support for TypeScript 5.1 and 5.2 (#2730)
  • worker.stop() returns a Promise (#2724). Awaiting it is relevant only for in-flight critical scenarios.
  • graphql is now exported as msw/graphql (#2691). GraphQL is now handled as a proper optional peer dependency.
  • Removes the handleRequest() utility. Please use the defineNetwork() API instead.
  • GraphQLLinkHandlers type has been renamed to GraphQLLink.
  • The file:// requests now throw in Node.js as they normally do (not supported by fetch).
  • The Content-Length request header is now removed by bypass().
  • HTTP-to-WebSocket upgrade requests performed via fetch() now throw in Node.js as they normally do (not supported by fetch).
  • Cookies are no longer managed in Node.js for better compatibility. Instead, whatever is the default behavior of your environment that's the cookie behavior you get. This has no effect on the browser.
  • WebSocket connection life cycle event has been renamed to websocket:connection (#2783).
  • onUnhandledRequest option has been renamed to onUnhandledFrame.
  • The library no longer patches setTimeout to circumvent fake timers in test runners. You should advance the fake timers normally for delayed mocked responses to resolve.
  • The library no longer returns a mocked cookie string on request.headers.get('cookie') in the handlers. It returns null in all environments. Please use the cookies resolver argument to have cookie-based logic.

Features

  • Supports Node.js v24 and v26.
  • Supports TypeScript v6.0 and v7.0.
  • You can import individual utilities, like delay or passthrough, from the new msw/utils entrypoint for smaller footprint on your bundle.
  • Support GraphQL v17.0.
  • Support intercepting page navigations and form submissions (#2721).

... (truncated)

Commits
  • 3560a94 chore(release): v3.0.3
  • 3818a81 fix(HandlersController): dispose of reset handlers (#2810)
  • d1fe8e6 fix: expose network context on enable in network sources (#2809)
  • 22a4626 test(node): add jsdom cors/preflight regression tests (#2808)
  • a32ee31 docs: add beehiiv to partners (#2805)
  • 501a591 chore: update github social image
  • a7fa5f0 chore(release): v3.0.2
  • 01b1084 docs: feature "msw/http" imports in README examples
  • e73c381 fix(vite): support virtual:msw imports in vitest (#2802)
  • 6d6aef1 chore(release): v3.0.1
  • Additional commits viewable in compare view

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Oct 22, 2026
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/msw-3.0.3 branch from f58aa27 to b296dc7 Compare October 23, 2026 15:51
Bumps [msw](https://github.com/mswjs/msw) from 2.15.0 to 3.0.3.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](mswjs/msw@v2.15.0...v3.0.3)

---
updated-dependencies:
- dependency-name: msw
  dependency-version: 3.0.3
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/npm_and_yarn/msw-3.0.3 branch from b296dc7 to 7f238e8 Compare October 23, 2026 18:33
msw v3 で server.listen の onUnhandledRequest オプションが
onUnhandledFrame に改名されたため、テストセットアップの指定を改名する。
また v3 では、中断済みの AbortSignal で FormData を POST すると傍受層が
中断後に body ストリームを読み Unhandled Rejection になるため、
presignedPostUpload のテストは応答待ちの間に中断する形に変える。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tri-star

Copy link
Copy Markdown
Owner

msw 2.15.0 → 3.0.3 への対応(自動対応、ユーザー不在で実施)

コミット 033d468 でテストを直しました。追加後の CI(mobile CI の check ほか)はすべて通っています。

修正内容

  • packages/mobile/src/test/setup.ts:v3 で server.listen の onUnhandledRequest が onUnhandledFrame に改名されたため、名前を変えました。CI の typecheck の失敗(TS2353)はこれが原因でした。
  • packages/mobile/src/features/pin/api/presignedPostUpload.test.ts:「意図的な中断(AbortError)はログしない」のテストで、中断のタイミングを変えました。
    • 変更前は、中断済みの signal で送信を始めていました。
    • 変更後は、ハンドラを delay("infinite") にし、応答待ちの間(20ms 後)に中断します。
    • 中断済みの signal で FormData を POST すると、msw v3 の傍受層が中断後に body のストリームを読み、ReadableStream is already closed の Unhandled Rejection で vitest が exit 1 になるためです。テストの件数としては全件通っていました。

影響なしと判断した breaking change

  • ESM-only 化:テストは vitest で動いているため影響しません。
  • Node 22 以上・TypeScript 5.9 以上が必要:engines(^22.13.0 || ^24.3.0 || >=26.0.0)、CI(Node 24)、TypeScript ~6.0.3 で満たしています。
  • msw/native の削除、msw/graphql への移動、handleRequest() の削除、worker.stop() の Promise 化:いずれもこのリポジトリでは使っていません。

ローカルで実行した確認

pnpm install --frozen-lockfile(lockfile の変更なし)のあと、pnpm --filter mobile で typecheck・lint・format:check・test を実行し、すべて通りました(194 ファイル・2579 件)。

判断ポイント(レビュー時に確認してください)

  1. Unhandled Rejection はアプリのコードではなくテスト側で回避しました。
    msw の傍受層とテスト環境だけの問題で、実機のアプリの挙動は変わらないと判断したためです。この変更で、このテストは「送信を始める前に中断済みだった場合」の経路を確かめなくなります。その経路もテストで守りたい場合は、msw / @mswjs/interceptors の修正を待って元の形に戻すことを検討してください。なお、原因は上の再現まで絞り込みましたが、msw 2.15 で再確認したり upstream の issue を調べたりはしていません。
  2. cookie の扱いなど、ほかの挙動の変更はテストが全件通ることで確認しました。 個別の確認はしていません。
  3. 独立レビュー(change-review)は省略しました。 変更がテストの 2 ファイル・7 行に限られるためです。

🤖 Generated with Claude Code

This branch has not been deployed

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

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant