Skip to content

Commit

Permalink
fix win test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqingc committed May 22, 2019
1 parent 7772fc1 commit cb76563
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions http/file_server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ 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"));
// assert(/<td class="mode">\([a-zA-Z-]{10}\)<\/td>/.test(page));
assert(/<td class="mode">\(unknown mode\)<\/td>/.test(page));

// `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>`
Expand Down

0 comments on commit cb76563

Please sign in to comment.