From a80b6a35bd8aae5b6bfb1db6d2159c7cd14e165d Mon Sep 17 00:00:00 2001
From: kleinfreund <5774638+kleinfreund@users.noreply.github.com>
Date: Wed, 17 Sep 2025 11:33:37 +0200
Subject: [PATCH 1/2] refactor(playwright): use `@msw/playwright` binding
Add @msw/playwright to the playwright example.
Update Playwright to avoid TypeError: this[#page].routeWebSocket is not a function errors when using @msw/playwright.
Use the `@msw/playwright` binding
---
examples/with-playwright/app/browser.js | 2 +-
examples/with-playwright/app/index.html | 6 +-
examples/with-playwright/example.test.ts | 3 +-
examples/with-playwright/package.json | 5 +-
examples/with-playwright/playwright.utils.ts | 15 ++++
examples/with-remix/package.json | 4 +-
examples/with-svelte/package.json | 4 +-
pnpm-lock.yaml | 94 +++++++++++---------
8 files changed, 83 insertions(+), 50 deletions(-)
create mode 100644 examples/with-playwright/playwright.utils.ts
diff --git a/examples/with-playwright/app/browser.js b/examples/with-playwright/app/browser.js
index f22cae1..4dd03f0 100644
--- a/examples/with-playwright/app/browser.js
+++ b/examples/with-playwright/app/browser.js
@@ -1,4 +1,4 @@
import { setupWorker } from 'msw/browser'
import { handlers } from './handlers'
-window.worker = setupWorker(...handlers)
+export const worker = setupWorker(...handlers)
diff --git a/examples/with-playwright/app/index.html b/examples/with-playwright/app/index.html
index 4d7261c..e4c6efc 100644
--- a/examples/with-playwright/app/index.html
+++ b/examples/with-playwright/app/index.html
@@ -7,9 +7,11 @@
-