Skip to content

Commit e0c26df

Browse files
authored
Merge pull request #13 from sapphi-red/test/make-tests-pass-on-windows
make tests pass on Windows
2 parents 0d35a4e + 6114624 commit e0c26df

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
@@ -116,7 +116,15 @@ async function loadTestWebsocketServerSerial({
116116
async function connectToProxy() {
117117
const req = http.request(options);
118118
req.end();
119-
const [res] = await once(req, "upgrade");
119+
const [event, [res]] = await Promise.race([
120+
once(req, "upgrade").then(v => ['upgrade', v] as const),
121+
once(req, "error").then(v => ['error', v] as const),
122+
])
123+
if (event === 'error') {
124+
// ignore ECONNREFUSED errors
125+
if (res.code == 'ECONNREFUSED') return;
126+
throw Error(res);
127+
}
120128
res.socket.end();
121129
}
122130

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)