From 905e458b66ae8293d2494f5e4c88b1e71f12ed5d Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 13 Nov 2024 16:25:09 +0900 Subject: [PATCH] fileInfo.mode is now available on windows --- http/file_server_test.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/http/file_server_test.ts b/http/file_server_test.ts index 55f5d564ee7a..9f83fc298983 100644 --- a/http/file_server_test.ts +++ b/http/file_server_test.ts @@ -188,14 +188,7 @@ Deno.test("serveDir() serves directory index", async () => { assertStringIncludes(page, 'hello.html'); assertStringIncludes(page, 'tls/'); assertStringIncludes(page, "%2525A.txt"); - // `Deno.FileInfo` is not completely compatible with Windows yet - // TODO(bartlomieju): `mode` should work correctly in the future. - // Correct this test case accordingly. - if (Deno.build.os === "windows") { - assertMatch(page, /(\s)*\(unknown mode\)(\s)*<\/td>/); - } else { - assertMatch(page, /(\s)*[a-zA-Z- ]{14}(\s)*<\/td>/); - } + assertMatch(page, /(\s)*[a-zA-Z- ]{14}(\s)*<\/td>/); await Deno.remove(filePath); }); @@ -212,14 +205,7 @@ Deno.test("serveDir() serves directory index with file containing space in the f assertStringIncludes(page, 'hello.html'); assertStringIncludes(page, 'tls/'); assertStringIncludes(page, "test%20file.txt"); - // `Deno.FileInfo` is not completely compatible with Windows yet - // TODO(bartlomieju): `mode` should work correctly in the future. - // Correct this test case accordingly. - if (Deno.build.os === "windows") { - assertMatch(page, /(\s)*\(unknown mode\)(\s)*<\/td>/); - } else { - assertMatch(page, /(\s)*[a-zA-Z- ]{14}(\s)*<\/td>/); - } + assertMatch(page, /(\s)*[a-zA-Z- ]{14}(\s)*<\/td>/); await Deno.remove(filePath); });