Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(std/http): server module name migration #11890

Merged
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cli/bench/deno_http_proxy.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
5 changes: 4 additions & 1 deletion cli/tests/testdata/045_proxy_test.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
15 changes: 8 additions & 7 deletions cli/tests/unit/http_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { TextProtoReader } from "../../../test_util/std/textproto/mod.ts";
import {
assert,
assertEquals,
assertRejects,
assertThrows,
assertThrowsAsync,
deferred,
delay,
fail,
Expand Down Expand Up @@ -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();
},
Expand Down Expand Up @@ -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(
Expand All @@ -299,8 +299,9 @@ unitTest(
);
},
Deno.errors.Http,
cancelReason!,
);
assertEquals(cancelReason, responseError);
assert(cancelReason!);
httpConn.close();
listener.close();
})();
Expand All @@ -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(
Expand Down Expand Up @@ -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==",
},
});
Expand Down
1 change: 1 addition & 0 deletions cli/tests/unit/test_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export {
assertEquals,
assertMatch,
assertNotEquals,
assertRejects,
assertStrictEquals,
assertStringIncludes,
assertThrows,
Expand Down
2 changes: 1 addition & 1 deletion test_util/std
Submodule std updated from 81314b to ca23a1