summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration_tests.rs6
-rw-r--r--cli/tests/websocket_test.ts22
2 files changed, 25 insertions, 3 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index 3c2154dff..44e56d246 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -403,7 +403,9 @@ fn fmt_stdin_error() {
}
// Warning: this test requires internet access.
+// TODO(#7412): reenable. test is flaky
#[test]
+#[ignore]
fn upgrade_in_tmpdir() {
let temp_dir = TempDir::new().unwrap();
let exe_path = temp_dir.path().join("deno");
@@ -423,7 +425,9 @@ fn upgrade_in_tmpdir() {
}
// Warning: this test requires internet access.
+// TODO(#7412): reenable. test is flaky
#[test]
+#[ignore]
fn upgrade_with_space_in_path() {
let temp_dir = tempfile::Builder::new()
.prefix("directory with spaces")
@@ -473,7 +477,9 @@ fn upgrade_with_version_in_tmpdir() {
}
// Warning: this test requires internet access.
+// TODO(#7412): reenable. test is flaky
#[test]
+#[ignore]
fn upgrade_with_out_in_tmpdir() {
let temp_dir = TempDir::new().unwrap();
let exe_path = temp_dir.path().join("deno");
diff --git a/cli/tests/websocket_test.ts b/cli/tests/websocket_test.ts
index 0fb9af951..93fddf446 100644
--- a/cli/tests/websocket_test.ts
+++ b/cli/tests/websocket_test.ts
@@ -1,5 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import {
+ assert,
assertEquals,
assertThrows,
createResolvable,
@@ -135,18 +136,33 @@ Deno.test("echo string", async () => {
});
Deno.test("echo string tls", async () => {
- const promise = createResolvable();
+ const promise1 = createResolvable();
+ const promise2 = createResolvable();
const ws = new WebSocket("wss://localhost:4243");
ws.onerror = (): void => fail();
ws.onopen = (): void => ws.send("foo");
ws.onmessage = (e): void => {
assertEquals(e.data, "foo");
ws.close();
+ promise1.resolve();
};
ws.onclose = (): void => {
- promise.resolve();
+ promise2.resolve();
};
- await promise;
+ await promise1;
+ await promise2;
+});
+
+Deno.test("websocket error", async () => {
+ const promise1 = createResolvable();
+ const ws = new WebSocket("wss://localhost:4242");
+ ws.onopen = () => fail();
+ ws.onerror = (err): void => {
+ assert(err instanceof ErrorEvent);
+ assertEquals(err.message, "InvalidData: received corrupt message");
+ promise1.resolve();
+ };
+ await promise1;
});
Deno.test("echo blob with binaryType blob", async () => {