diff options
author | 木杉 <zhmushan@qq.com> | 2019-12-03 08:14:25 +0800 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-12-02 16:14:25 -0800 |
commit | cfa4f540baac5beaf168de3e818c882ccbd95136 (patch) | |
tree | 5a685c28a9783f5abe3337dd2ab9679c81022419 /std/http/file_server_test.ts | |
parent | 136b5e3da2c689b54b34c46fa41973e0ccca66ab (diff) |
better html for file_server (#3423)
Diffstat (limited to 'std/http/file_server_test.ts')
-rw-r--r-- | std/http/file_server_test.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/std/http/file_server_test.ts b/std/http/file_server_test.ts index 77467b8c8..7d7e024e7 100644 --- a/std/http/file_server_test.ts +++ b/std/http/file_server_test.ts @@ -36,10 +36,6 @@ test(async function serveFile(): Promise<void> { const res = await fetch("http://localhost:4500/README.md"); assert(res.headers.has("access-control-allow-origin")); assert(res.headers.has("access-control-allow-headers")); - assertEquals( - res.headers.get("content-type"), - "text/markdown; charset=utf-8" - ); const downloadedFile = await res.text(); const localFile = new TextDecoder().decode( await Deno.readFile("README.md") @@ -63,10 +59,10 @@ test(async function serveDirectory(): Promise<void> { // TODO: `mode` should work correctly in the future. // Correct this test case accordingly. Deno.build.os !== "win" && - assert(/<td class="mode">\([a-zA-Z-]{10}\)<\/td>/.test(page)); + assert(/<td class="mode">(\s)*\([a-zA-Z-]{10}\)(\s)*<\/td>/.test(page)); Deno.build.os === "win" && - assert(/<td class="mode">\(unknown mode\)<\/td>/.test(page)); - assert(page.includes(`<td><a href="/README.md">README.md</a></td>`)); + assert(/<td class="mode">(\s)*\(unknown mode\)(\s)*<\/td>/.test(page)); + assert(page.includes(`<a href="/README.md">README.md</a>`)); } finally { killFileServer(); } |