diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-11-12 17:10:07 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-12 17:10:07 +0530 |
commit | 3b99f6833cd3354da20785fdcf01e7409e610175 (patch) | |
tree | 8539e551c52b880d704d27e26a4bb5b0191515e6 /tests/unit | |
parent | c3c2b379669b17e5fdcbe5e62662404ca22c71c6 (diff) |
fix(ext/websocket): initialize `error` attribute of WebSocket ErrorEvent (#26796)
Fixes https://github.com/denoland/deno/issues/26216
Not required by the spec but Discord.js depends on it, see
https://github.com/denoland/deno/issues/26216#issuecomment-2466060306
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/websocket_test.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unit/websocket_test.ts b/tests/unit/websocket_test.ts index 7db876b17..3aafe8da2 100644 --- a/tests/unit/websocket_test.ts +++ b/tests/unit/websocket_test.ts @@ -453,7 +453,8 @@ Deno.test("invalid server", async () => { const { promise, resolve } = Promise.withResolvers<void>(); const ws = new WebSocket("ws://localhost:2121"); let err = false; - ws.onerror = () => { + ws.onerror = (e) => { + assert("error" in e); err = true; }; ws.onclose = () => { |