From cfa4f540baac5beaf168de3e818c882ccbd95136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=9D=89?= Date: Tue, 3 Dec 2019 08:14:25 +0800 Subject: better html for file_server (#3423) --- std/http/file_server_test.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'std/http/file_server_test.ts') 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 { 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 { // TODO: `mode` should work correctly in the future. // Correct this test case accordingly. Deno.build.os !== "win" && - assert(/\([a-zA-Z-]{10}\)<\/td>/.test(page)); + assert(/(\s)*\([a-zA-Z-]{10}\)(\s)*<\/td>/.test(page)); Deno.build.os === "win" && - assert(/\(unknown mode\)<\/td>/.test(page)); - assert(page.includes(`README.md`)); + assert(/(\s)*\(unknown mode\)(\s)*<\/td>/.test(page)); + assert(page.includes(`README.md`)); } finally { killFileServer(); } -- cgit v1.2.3