Skip to content

Commit

Permalink
fix: re-enable chast server example tests
Browse files Browse the repository at this point in the history
  • Loading branch information
keroxp committed Mar 22, 2020
1 parent 12ff78e commit 3780e04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions std/examples/chat/server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { delay } from "../../util/async.ts";

const port = randomPort();

const { test, build } = Deno;
const { test } = Deno;

async function startServer(): Promise<Deno.Process> {
const server = Deno.run({
Expand All @@ -35,11 +35,7 @@ async function startServer(): Promise<Deno.Process> {
return server;
}

// TODO: https://github.com/denoland/deno/issues/4108
const ignore = build.os == "win";

test({
ignore,
name: "GET / should serve html",
async fn() {
const server = await startServer();
Expand All @@ -58,7 +54,6 @@ test({
});

test({
ignore,
name: "GET /ws should upgrade conn to ws",
async fn() {
const server = await startServer();
Expand Down
6 changes: 3 additions & 3 deletions std/http/server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,10 @@ test({
await req.respond({ body: new TextEncoder().encode(req.url) });
}
}

const server = serve(":8123");
const port = randomPort();
const server = serve({ port });
const p = iteratorReq(server);
const conn = await Deno.connect({ hostname: "127.0.0.1", port: 8123 });
const conn = await Deno.connect({ hostname: "127.0.0.1", port });
await Deno.writeAll(
conn,
new TextEncoder().encode("GET /hello HTTP/1.1\r\n\r\n")
Expand Down

0 comments on commit 3780e04

Please sign in to comment.