diff options
author | crowlKats <13135287+crowlKats@users.noreply.github.com> | 2020-11-25 15:17:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 15:17:46 +0100 |
commit | d40b0711a786d04b5e6321ae9bbf73c11220e865 (patch) | |
tree | 77f59e4441108bd4659ef12e193f74389c04a9c5 /cli/tests | |
parent | fb13967d1dd3aa7cc216b3f977a06d9718ae3678 (diff) |
fix(websocket): Fix PermissionDenied error being caught in constructor (#8402)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/unit/unit_tests.ts | 1 | ||||
-rw-r--r-- | cli/tests/unit/websocket_test.ts | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/unit/unit_tests.ts b/cli/tests/unit/unit_tests.ts index f545e55fa..6885204a3 100644 --- a/cli/tests/unit/unit_tests.ts +++ b/cli/tests/unit/unit_tests.ts @@ -79,3 +79,4 @@ import "./write_file_test.ts"; import "./write_text_file_test.ts"; import "./performance_test.ts"; import "./version_test.ts"; +import "./websocket_test.ts"; diff --git a/cli/tests/unit/websocket_test.ts b/cli/tests/unit/websocket_test.ts new file mode 100644 index 000000000..8e5726d44 --- /dev/null +++ b/cli/tests/unit/websocket_test.ts @@ -0,0 +1,9 @@ +// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +import { assertThrows, unitTest } from "./test_util.ts"; + +unitTest(function websocketPermissionless() { + assertThrows( + () => new WebSocket("ws://localhost"), + Deno.errors.PermissionDenied, + ); +}); |