summaryrefslogtreecommitdiff
path: root/http/file_server_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'http/file_server_test.ts')
-rw-r--r--http/file_server_test.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/http/file_server_test.ts b/http/file_server_test.ts
index 38071d3e4..578b0e624 100644
--- a/http/file_server_test.ts
+++ b/http/file_server_test.ts
@@ -56,6 +56,18 @@ test(async function serveDirectory(): Promise<void> {
assert(res.headers.has("access-control-allow-headers"));
const page = await res.text();
assert(page.includes("azure-pipelines.yml"));
+
+ // `Deno.FileInfo` is not completely compatible with Windows yet
+ // TODO: `mode` should work correctly in the future. Correct this test case accordingly.
+ Deno.platform.os !== "win" &&
+ assert(/<td class="mode">\([a-zA-Z-]{10}\)<\/td>/.test(page));
+ Deno.platform.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>`
+ )
+ );
} finally {
killFileServer();
}