summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--cli/bench/deno_http_proxy.ts2
-rw-r--r--cli/tests/testdata/045_proxy_test.ts5
-rw-r--r--cli/tests/unit/http_test.ts15
-rw-r--r--cli/tests/unit/test_util.ts1
m---------test_util/std0
6 files changed, 15 insertions, 10 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4cf411c9e..fe8ba756c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -89,7 +89,7 @@ jobs:
- name: Install Deno
if: matrix.job == 'lint'
run: |
- curl -fsSL https://deno.land/x/install/install.sh | sh -s v1.11.3
+ curl -fsSL https://deno.land/x/install/install.sh | sh -s v1.13.2
echo "$HOME/.deno/bin" >> $GITHUB_PATH
- name: Install Python
diff --git a/cli/bench/deno_http_proxy.ts b/cli/bench/deno_http_proxy.ts
index fc756f80f..7295baff5 100644
--- a/cli/bench/deno_http_proxy.ts
+++ b/cli/bench/deno_http_proxy.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-import { serve, ServerRequest } from "../test_util/std/http/server.ts";
+import { serve, ServerRequest } from "../test_util/std/http/server_legacy.ts";
const addr = Deno.args[0] || "127.0.0.1:4500";
const originAddr = Deno.args[1] || "127.0.0.1:4501";
diff --git a/cli/tests/testdata/045_proxy_test.ts b/cli/tests/testdata/045_proxy_test.ts
index 6d8359518..1433b426a 100644
--- a/cli/tests/testdata/045_proxy_test.ts
+++ b/cli/tests/testdata/045_proxy_test.ts
@@ -1,5 +1,8 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-import { serve, ServerRequest } from "../../../test_util/std/http/server.ts";
+import {
+ serve,
+ ServerRequest,
+} from "../../../test_util/std/http/server_legacy.ts";
import { assertEquals } from "../../../test_util/std/testing/asserts.ts";
const addr = Deno.args[1] || "127.0.0.1:4555";
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts
index 680531876..ccacfd751 100644
--- a/cli/tests/unit/http_test.ts
+++ b/cli/tests/unit/http_test.ts
@@ -6,8 +6,8 @@ import { TextProtoReader } from "../../../test_util/std/textproto/mod.ts";
import {
assert,
assertEquals,
+ assertRejects,
assertThrows,
- assertThrowsAsync,
deferred,
delay,
fail,
@@ -187,7 +187,7 @@ unitTest({ perms: { net: true } }, async function httpServerInvalidMethod() {
const client = await Deno.connect({ port: 4501 });
const httpConn = Deno.serveHttp(await listener.accept());
await client.write(new Uint8Array([1, 2, 3]));
- await assertThrowsAsync(
+ await assertRejects(
async () => {
await httpConn.nextRequest();
},
@@ -277,8 +277,8 @@ unitTest(
const event = await httpConn.nextRequest();
assert(event);
const { respondWith } = event;
- let cancelReason = null;
- const responseError = await assertThrowsAsync(
+ let cancelReason: string;
+ await assertRejects(
async () => {
let interval = 0;
await respondWith(
@@ -299,8 +299,9 @@ unitTest(
);
},
Deno.errors.Http,
+ cancelReason!,
);
- assertEquals(cancelReason, responseError);
+ assert(cancelReason!);
httpConn.close();
listener.close();
})();
@@ -323,7 +324,7 @@ unitTest(
// Start polling for the next request before awaiting response.
const nextRequestPromise = httpConn.nextRequest();
const { respondWith } = event;
- await assertThrowsAsync(
+ await assertRejects(
async () => {
let interval = 0;
await respondWith(
@@ -710,7 +711,7 @@ unitTest(function httpUpgradeWebSocketCaseInsensitiveUpgradeHeader() {
const request = new Request("https://deno.land/", {
headers: {
connection: "upgrade",
- upgrade: "WebSocket",
+ upgrade: "websocket",
"sec-websocket-key": "dGhlIHNhbXBsZSBub25jZQ==",
},
});
diff --git a/cli/tests/unit/test_util.ts b/cli/tests/unit/test_util.ts
index 6745946c6..6508abd20 100644
--- a/cli/tests/unit/test_util.ts
+++ b/cli/tests/unit/test_util.ts
@@ -12,6 +12,7 @@ export {
assertEquals,
assertMatch,
assertNotEquals,
+ assertRejects,
assertStrictEquals,
assertStringIncludes,
assertThrows,
diff --git a/test_util/std b/test_util/std
-Subproject 81314bcab8b5dc2fef85ec65f8588cab1706337
+Subproject ca23a1e6035ebf34152ab1f20b46f1c3c9a11a5