summaryrefslogtreecommitdiff
path: root/std/http/file_server_test.ts
diff options
context:
space:
mode:
authorNick Stott <nick@nickstott.com>2019-10-19 16:55:20 -0400
committerRy Dahl <ry@tinyclouds.org>2019-10-19 16:55:20 -0400
commitc876d1adb40a79e7a052ae0ae1b1956a4a0866ea (patch)
treeaeaf7401e48e241be158eab7d895009aa8f670a9 /std/http/file_server_test.ts
parentb112e14b165bb5791608343a74469bfe2c762c58 (diff)
Re-enable some tests (#3154)
Ref #3095
Diffstat (limited to 'std/http/file_server_test.ts')
-rw-r--r--std/http/file_server_test.ts17
1 files changed, 8 insertions, 9 deletions
diff --git a/std/http/file_server_test.ts b/std/http/file_server_test.ts
index 958c66529..16540bffa 100644
--- a/std/http/file_server_test.ts
+++ b/std/http/file_server_test.ts
@@ -30,17 +30,19 @@ function killFileServer(): void {
fileServer.stdout!.close();
}
-/* TODO(ry) re-enable tests
test(async function serveFile(): Promise<void> {
await startFileServer();
try {
- const res = await fetch("http://localhost:4500/azure-pipelines.yml");
+ const res = await fetch("http://localhost:4500/tsconfig.json");
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
- assertEquals(res.headers.get("content-type"), "text/yaml; charset=utf-8");
+ assertEquals(
+ res.headers.get("content-type"),
+ "application/json; charset=utf-8"
+ );
const downloadedFile = await res.text();
const localFile = new TextDecoder().decode(
- await Deno.readFile("./azure-pipelines.yml")
+ await Deno.readFile("./tsconfig.json")
);
assertEquals(downloadedFile, localFile);
} finally {
@@ -55,7 +57,7 @@ test(async function serveDirectory(): Promise<void> {
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
const page = await res.text();
- assert(page.includes("azure-pipelines.yml"));
+ assert(page.includes("tsconfig.json"));
// `Deno.FileInfo` is not completely compatible with Windows yet
// TODO: `mode` should work correctly in the future.
@@ -65,15 +67,12 @@ test(async function serveDirectory(): Promise<void> {
Deno.build.os === "win" &&
assert(/<td class="mode">\(unknown mode\)<\/td>/.test(page));
assert(
- page.includes(
- `<td><a href="/azure-pipelines.yml">azure-pipelines.yml</a></td>`
- )
+ page.includes(`<td><a href="/tsconfig.json">tsconfig.json</a></td>`)
);
} finally {
killFileServer();
}
});
-*/
test(async function serveFallback(): Promise<void> {
await startFileServer();