Skip to content

Commit 9881157

Browse files
authored
feat: support WebSockets (#3)
1 parent 531979b commit 9881157

File tree

8 files changed

+571
-21
lines changed

8 files changed

+571
-21
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: ci
33
on:
44
push:
55
branches:
6+
- main
67
pull_request:
78
branches:
89
workflow_dispatch:

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,3 @@ test('displays the user dashboard', async ({ worker, page }) => {
6565
await page.goto('/dashboard')
6666
})
6767
```
68-
69-
## Limitations
70-
71-
### WebSocket support
72-
73-
This library _does not support mocking WebSockets_ at the moment. That support requires a refactoring on MSW side to expose `handleWebSocketEvent()` and simplify its call signature (it really only needs the client url). Once that refactoring is done, we will use `page.routeWebSocket()` to provision the WebSocket support.

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,19 @@
4040
"node": ">=20.0.0"
4141
},
4242
"peerDependencies": {
43-
"msw": "^2.9.0"
43+
"msw": "^2.10.1"
4444
},
4545
"devDependencies": {
46+
"@epic-web/test-server": "^0.1.6",
4647
"@ossjs/release": "^0.8.1",
4748
"@playwright/test": "^1.52.0",
4849
"@types/node": "^22.15.29",
49-
"msw": "^2.9.0",
50+
"msw": "^2.10.1",
5051
"tsdown": "^0.12.7",
5152
"typescript": "^5.8.3"
53+
},
54+
"dependencies": {
55+
"@mswjs/interceptors": "^0.39.2",
56+
"outvariant": "^1.4.3"
5257
}
53-
}
58+
}

pnpm-lock.yaml

Lines changed: 88 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)