Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
bf45da8
feat!: migrate to `@msw/url` (#2678)
kettanaito Apr 6, 2026
d03cf86
Merge branch 'main' into feat/3.0
kettanaito Apr 6, 2026
61dd37d
Merge branch 'main' into feat/3.0
kettanaito Apr 17, 2026
973efc5
fix: use `pagehide` instead of `beforeunload` for tracking closing pa…
kettanaito Apr 17, 2026
b888ea0
Merge branch 'main' into feat/3.0
kettanaito Apr 17, 2026
914daa4
feat: support navigate requests (#2721)
kettanaito Apr 20, 2026
d31f517
fix: await in-flight requests from closing clients (#2724)
kettanaito Apr 20, 2026
3d2c98e
Merge branch 'main' into feat/3.0
kettanaito Apr 29, 2026
9eb5e9b
feat: drop support for Node.js 18, 20 (#2729)
kettanaito Apr 29, 2026
dfd9c77
chore: use `Headers.getSetCookie` (#2730)
kettanaito Apr 29, 2026
e6ffe7d
Merge branch 'main' into feat/3.0
kettanaito May 11, 2026
557f0ad
Merge branch 'main' into feat/3.0
kettanaito May 12, 2026
6ada87e
Merge branch 'main' into feat/3.0
kettanaito May 12, 2026
da31ab2
Merge branch 'main' into feat/3.0
kettanaito Jul 7, 2026
45bb7be
chore: upgrade to latest `undici`
kettanaito Jul 7, 2026
e44b098
chore: drop `node-websocket` environment
kettanaito Jul 7, 2026
929b6b8
fix(WebSocketClientManager): add missing imports
kettanaito Jul 7, 2026
643bf48
fix: update to esm-only `cookie`
kettanaito Jul 7, 2026
99de29a
chore: run e2e tests on node 22
kettanaito Jul 7, 2026
e1fc07c
chore: update node.js version in the issue template
kettanaito Jul 7, 2026
8d55a9d
Merge branch 'main' into feat/3.0
kettanaito Jul 7, 2026
b8ea7a1
chore: update `@msw/url`
kettanaito Jul 7, 2026
d2fb0c9
Merge branch 'main' into feat/3.0
kettanaito Jul 7, 2026
40aa5b0
Merge branch 'main' into feat/3.0
kettanaito Jul 7, 2026
2c38b17
chore: prevent poisoned cache
kettanaito Jul 7, 2026
013012b
chore: switch build to tsdown (#2760)
Andarist Jul 8, 2026
00fe4e0
feat!: `msw/graphql`, `graphql` as an optional peer dependency (#2691)
kettanaito Jul 8, 2026
05bde09
Merge branch 'main' into feat/3.0
kettanaito Jul 8, 2026
8979bff
feat: support GraphQL subscriptions (#2763)
kettanaito Jul 18, 2026
d9f389d
feat: upgrade `graphql` to v17
kettanaito Jul 18, 2026
ca3062d
chore: drop `DeferredPromise` in favor of `Promise.withResolvers`
kettanaito Jul 18, 2026
5283bf7
fix(worker): buffer navigation responses
kettanaito Jul 18, 2026
be2ae7c
feat!: migrate to esm-only (#2765)
kettanaito Jul 18, 2026
40cff43
fix: remove obsolete `handleRequest`
kettanaito Jul 18, 2026
6101e1a
chore: delete unused `pipeEvents`
kettanaito Jul 18, 2026
e6c09a0
chore: migrate to `rettime`, delete `strict-event-emitter`
kettanaito Jul 18, 2026
3e30e2e
feat: make `graphql` link-first
kettanaito Jul 18, 2026
ae1516e
fix(graphql): protocol-based subscription claiming
kettanaito Jul 18, 2026
0bda640
test: correct graphql url
kettanaito Jul 18, 2026
9758a82
feat: export websocket as `msw/ws`
kettanaito Jul 18, 2026
abb052d
feat: add `msw/http` mirror export path
kettanaito Jul 18, 2026
8f484ea
chore: move implementation to `msw/http`, re-export from root
kettanaito Jul 18, 2026
06d5fd4
chore: fix imports in type tests
kettanaito Jul 18, 2026
306ab56
fix: re-export `ws` from root
kettanaito Jul 18, 2026
7f9e908
chore: move ws utils under ws
kettanaito Jul 18, 2026
c06f6a5
chore: rely on ts to resolve #imports
kettanaito Jul 18, 2026
f4edd7d
chore: remove obsolete `waitFor` utility
kettanaito Jul 18, 2026
4339965
feat: set minimal supported ts version to 5.9
kettanaito Jul 18, 2026
a20cdc8
chore: use typescript@7 for development
kettanaito Jul 18, 2026
e5bb2e6
fix: inline `statuses`
kettanaito Jul 18, 2026
f692a2b
chore: replace `picocolors` with `styleText`
kettanaito Jul 18, 2026
3548d4b
chore: remove `headers-polyfill` usage from playwright tests
kettanaito Jul 18, 2026
f09e74b
chore: use pnpm@11.5.2
kettanaito Jul 21, 2026
0507f47
chore: re-generate lockfile
kettanaito Jul 21, 2026
7da29b5
chore: run react-native tests on node 22
kettanaito Jul 21, 2026
233510f
chore: drop legacy forceFileExtensionsPlugin (#2768)
Andarist Jul 22, 2026
4663845
feat: adopt the new interceptors architecture (#2767)
kettanaito Jul 22, 2026
2a80603
chore: update dependencies
kettanaito Jul 24, 2026
9c79d2e
Merge branch 'main' into feat/3.0
kettanaito Sep 7, 2026
e03809e
chore: migrate to vitest browser mode (#2778)
kettanaito Sep 7, 2026
5adb774
feat: remove `postinstall` script
kettanaito Sep 7, 2026
666df48
chore: remove unused dependencies, types, and functions
kettanaito Sep 7, 2026
cd237d9
feat: rename `msw/native` to `msw/react-native`
kettanaito Sep 8, 2026
9f8d63b
test(graphql): prevent flakiness via `expect.poll`
kettanaito Sep 8, 2026
3984f1a
feat: remove cookie handling from node.js (#2779)
kettanaito Sep 8, 2026
82f94b3
chore: fix flaky test via `expect.poll`
kettanaito Sep 8, 2026
4cfc7a6
chore: update to `@mswjs/interceptors@0.42.4`
kettanaito Sep 8, 2026
ee3e04d
chore: support node v26
kettanaito Sep 8, 2026
38009d0
Merge branch 'main' into feat/3.0
kettanaito Sep 10, 2026
96e1b3f
feat: msw vite plugin (#2781)
kettanaito Sep 10, 2026
8ccc132
feat(ws): rename `connection` event to `websocket:connection` (#2783)
kettanaito Sep 16, 2026
6eb44dc
chore: add `./http` to core ts modules
kettanaito Sep 16, 2026
7f37c65
feat(ws): add `websocket:error` event (#2784)
kettanaito Sep 16, 2026
82aa42a
fix: move `WebSocketHandler` under `msw/ws`
kettanaito Sep 16, 2026
1569158
feat: move sse under `msw/sse`
kettanaito Sep 16, 2026
371a803
chore: improve websocket types
kettanaito Sep 16, 2026
e834101
feat: export utils from `msw/utils`
kettanaito Sep 16, 2026
b07d912
fix: remove `checkGlobals` from `msw`
kettanaito Sep 16, 2026
e3b8a10
feat: remove `msw/native`
kettanaito Sep 16, 2026
bcb1952
chore: remove unused things
kettanaito Sep 16, 2026
de523a7
chore: lint on barrel file imports
kettanaito Sep 16, 2026
ed65765
test: use consistent `node` environment comment
kettanaito Sep 16, 2026
384f750
feat: remove deprecated apis
kettanaito Sep 16, 2026
176b886
fix: expose `network.readyState`, simplify test setup
kettanaito Sep 16, 2026
29f9165
fix: remove `onUnhandledRequest`
kettanaito Sep 16, 2026
f272702
fix: improve double enable errors
kettanaito Sep 16, 2026
1c72884
fix(ServiceWorkerSource): remove enable-after-enabled warnings
kettanaito Sep 16, 2026
304e5f1
chore: simplify tsdown config (#2769)
Andarist Sep 17, 2026
c4397e4
chore: use `test()` consistently
kettanaito Sep 17, 2026
9319d98
fix: consistent forbidden request headers behavior (#2785)
kettanaito Sep 17, 2026
aeb4676
chore: rename `defineNetwork` test utility
kettanaito Sep 17, 2026
f0affed
feat: forward request headers on passthrough (#2786)
kettanaito Sep 18, 2026
bcd3d2d
fix(ws): proper wildcard handling with protocol (#2788)
kettanaito Sep 18, 2026
f351938
fix: persist cookies safely (#2789)
kettanaito Sep 18, 2026
42697fb
fix: accommodate to new websocket protocol architecture (#2790)
kettanaito Sep 21, 2026
4104a17
feat(WebSocket): support extensions (#2791)
kettanaito Sep 24, 2026
13144a2
fix(vite): ensure worker is served in static builds
kettanaito Sep 25, 2026
3f81f5d
chore: use kebab-case consistently
kettanaito Sep 25, 2026
1536617
chore: enforce naming convention on linting level
kettanaito Sep 25, 2026
26da4fd
fix: prevent network frames from leaking memory (#2793)
kettanaito Sep 25, 2026
3b99f42
fix(ws): support custom websocket client/server instances
kettanaito Sep 25, 2026
b3c78ac
chore: update `@mswjs/interceptors` to 0.45.3
kettanaito Sep 25, 2026
db778a2
fix: update `rettime` to 0.11.12
kettanaito Sep 25, 2026
3b1b111
fix: export unhandled frame types
kettanaito Sep 28, 2026
ab862b6
fix: export `isPassthroughResponse` from `msw/utils/passthrough`
kettanaito Sep 28, 2026
07d191f
fix: export `getResponse` from `msw/utils/get-response`
kettanaito Sep 28, 2026
1bf7e99
chore: migrate to pnpm 11.27.1
kettanaito Sep 28, 2026
d208848
fix(HandlersController): type-safe `getHandlersByKind`
kettanaito Sep 28, 2026
350679f
fix(ws): upgrade websocket connections lazily (#2794)
kettanaito Sep 28, 2026
62890a9
chore: update dependencies
kettanaito Sep 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/02-issue-nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Bug report (Node.js)'
description: I experience unexpected behavior using the library in Node.js (Vitest/React Native/Express/etc.).
description: I experience unexpected behavior using the library in Node.js (Vitest/Express/etc.).
labels: ['bug', 'scope:node', 'needs:triage']
body:
- type: markdown
Expand All @@ -23,7 +23,7 @@ body:
options:
- label: I'm using the [latest](https://github.com/mswjs/msw/releases/latest) `msw` version
required: true
- label: I'm using Node.js version 20 or higher
- label: I'm using Node.js version 22 or higher
required: true

- type: input
Expand Down
262 changes: 18 additions & 244 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,274 +10,48 @@ permissions:
contents: read

jobs:
build-20:
name: build (20)
runs-on: blacksmith-4vcpu-ubuntu-2404
build:
name: build (Node.js ${{ matrix.nodeVersion }})
runs-on: blacksmith-8vcpu-ubuntu-2404
strategy:
fail-fast: false
matrix:
nodeVersion: ['22.23.2', '24', '26']
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0
version: 11.27.1

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 20
cache: 'pnpm'
node-version: ${{ matrix.nodeVersion }}

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint

- name: Build
run: pnpm build

- name: Cache build output
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ./lib
key: ${{ runner.os }}-node-20-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-20
build-22:
name: build (22)
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 22

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
run: pnpm exec playwright install chromium --with-deps --only-shell

- name: Lint
run: pnpm lint

- name: Build
run: pnpm build

- name: Cache build output
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ./lib
key: ${{ runner.os }}-node-22-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-22
test-unit:
name: test (unit)
needs: build-22
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 22

- name: Restore build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ./lib
key: ${{ runner.os }}-node-22-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-node-22-build-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Playwright browsers
run: pnpm exec playwright install chromium --with-deps --only-shell
- name: Tests
run: pnpm test

- name: Unit tests
run: pnpm test:unit
- name: Playwright tests
run: pnpm test:playwright

test-node-20:
name: test (node.js) (20)
needs: build-20
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 20

- name: Restore build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ./lib
key: ${{ runner.os }}-node-20-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-node-20-build-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Node.js tests
run: pnpm test:node

- name: Memory tests
run: pnpm test:memory

test-node-22:
name: test (node.js) (22)
needs: build-22
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 22

- name: Restore build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ./lib
key: ${{ runner.os }}-node-22-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-node-22-build-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Node.js tests
run: pnpm test:node

- name: Memory tests
run: pnpm test:memory

test-e2e:
name: test (e2e) (20)
needs: build-20
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 20

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: E2E tests
run: pnpm test:e2e

test-browser:
name: test (browser)
needs: build-22
runs-on: blacksmith-8vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 22

- name: Restore build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ./lib
key: ${{ runner.os }}-node-22-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-node-22-build-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Playwright install
run: pnpm exec playwright install chromium --with-deps --only-shell

- name: Browser tests
run: pnpm test:browser

- name: Upload test artifacts
- name: Upload Playwright artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: playwright-report
path: test/browser/test-results

test-native:
name: test (react-native)
needs: build-20
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 20

- name: Restore build cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
with:
path: ./lib
key: ${{ runner.os }}-node-20-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-node-20-build-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: React Native tests
run: pnpm test:native
name: playwright-report-node-${{ matrix.nodeVersion }}
path: test/test-results
6 changes: 3 additions & 3 deletions .github/workflows/compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0
version: 11.27.1

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
matrix:
# As a general rule, when adding a new version, remove the oldest version
# Check if the oldest version is EOL or not first.
ts: ['5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '5.8']
ts: ['5.9', '6.0', '7.0']
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
Expand All @@ -69,7 +69,7 @@ jobs:

- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0
version: 11.27.1

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0
version: 11.27.1

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0
version: 11.27.1

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0
version: 11.27.1

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0
version: 11.27.1

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typescript-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
with:
version: 9.15.0
version: 11.27.1

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ msw-*.tgz
**/test-results
/test/modules/node/node-esm-tests
*.tsbuildinfo
.pnpm-store/

# Smoke test temporary files.
/package.json.copy
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v24
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

Loading
Loading