Skip to content

Commit c876d1a

Browse files
nstottry
authored andcommitted
Re-enable some tests (#3154)
Ref #3095
1 parent b112e14 commit c876d1a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

std/http/file_server_test.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@ function killFileServer(): void {
3030
fileServer.stdout!.close();
3131
}
3232

33-
/* TODO(ry) re-enable tests
3433
test(async function serveFile(): Promise<void> {
3534
await startFileServer();
3635
try {
37-
const res = await fetch("http://localhost:4500/azure-pipelines.yml");
36+
const res = await fetch("http://localhost:4500/tsconfig.json");
3837
assert(res.headers.has("access-control-allow-origin"));
3938
assert(res.headers.has("access-control-allow-headers"));
40-
assertEquals(res.headers.get("content-type"), "text/yaml; charset=utf-8");
39+
assertEquals(
40+
res.headers.get("content-type"),
41+
"application/json; charset=utf-8"
42+
);
4143
const downloadedFile = await res.text();
4244
const localFile = new TextDecoder().decode(
43-
await Deno.readFile("./azure-pipelines.yml")
45+
await Deno.readFile("./tsconfig.json")
4446
);
4547
assertEquals(downloadedFile, localFile);
4648
} finally {
@@ -55,7 +57,7 @@ test(async function serveDirectory(): Promise<void> {
5557
assert(res.headers.has("access-control-allow-origin"));
5658
assert(res.headers.has("access-control-allow-headers"));
5759
const page = await res.text();
58-
assert(page.includes("azure-pipelines.yml"));
60+
assert(page.includes("tsconfig.json"));
5961

6062
// `Deno.FileInfo` is not completely compatible with Windows yet
6163
// TODO: `mode` should work correctly in the future.
@@ -65,15 +67,12 @@ test(async function serveDirectory(): Promise<void> {
6567
Deno.build.os === "win" &&
6668
assert(/<td class="mode">\(unknown mode\)<\/td>/.test(page));
6769
assert(
68-
page.includes(
69-
`<td><a href="/azure-pipelines.yml">azure-pipelines.yml</a></td>`
70-
)
70+
page.includes(`<td><a href="/tsconfig.json">tsconfig.json</a></td>`)
7171
);
7272
} finally {
7373
killFileServer();
7474
}
7575
});
76-
*/
7776

7877
test(async function serveFallback(): Promise<void> {
7978
await startFileServer();

0 commit comments

Comments
 (0)