Skip to content

Commit 6114624

Browse files
committed
make tests pass on Windows
1 parent f8beba7 commit 6114624

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/test/websocket/websocket-load.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,15 @@ async function loadTestWebsocketServerSerial({
115115
async function connectToProxy() {
116116
const req = http.request(options);
117117
req.end();
118-
const [res] = await once(req, "upgrade");
118+
const [event, [res]] = await Promise.race([
119+
once(req, "upgrade").then(v => ['upgrade', v] as const),
120+
once(req, "error").then(v => ['error', v] as const),
121+
])
122+
if (event === 'error') {
123+
// ignore ECONNREFUSED errors
124+
if (res.code == 'ECONNREFUSED') return;
125+
throw Error(res);
126+
}
119127
res.socket.end();
120128
}
121129

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ onlyBuiltDependencies:
33
overrides:
44
brace-expansion@>=1.0.0 <=1.1.11: '>=1.1.12'
55
brace-expansion@>=2.0.0 <=2.0.1: '>=2.0.2'
6+
shellEmulator: true

0 commit comments

Comments
 (0)