diff --git a/.github/codecov.yml b/.github/codecov.yml index 060eb6073533..de3e4b49402b 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,3 +1,8 @@ comment: false codecov: require_ci_to_pass: true +coverage: + status: + project: + default: + informational: true diff --git a/path/from_file_url_test.ts b/path/from_file_url_test.ts index 61a45a89bec0..aa230dcb66fa 100644 --- a/path/from_file_url_test.ts +++ b/path/from_file_url_test.ts @@ -25,13 +25,18 @@ Deno.test("[path] fromFileUrl", function () { ); }); +const isCanary = /\d\.\d\.\d\+[0-9a-f]{7}/.test(Deno.version.deno); + Deno.test("[path] fromFileUrl (win32)", function () { assertEquals(win32.fromFileUrl(new URL("file:///home/foo")), "\\home\\foo"); assertEquals(win32.fromFileUrl("file:///"), "\\"); assertEquals(win32.fromFileUrl("file:///home/foo"), "\\home\\foo"); assertEquals(win32.fromFileUrl("file:///home/foo%20bar"), "\\home\\foo bar"); assertEquals(win32.fromFileUrl("file:///%"), "\\%"); - assertEquals(win32.fromFileUrl("file://localhost/foo"), "\\\\localhost\\foo"); + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertEquals(win32.fromFileUrl("file://localhost/foo"), "\\foo"); + } assertEquals(win32.fromFileUrl("file:///C:"), "C:\\"); assertEquals(win32.fromFileUrl("file:///C:/"), "C:\\"); // Drop the hostname if a drive letter is parsed. diff --git a/path/to_file_url_test.ts b/path/to_file_url_test.ts index c4ee1a2368e2..9d2287a24436 100644 --- a/path/to_file_url_test.ts +++ b/path/to_file_url_test.ts @@ -2,9 +2,14 @@ import { posix, win32 } from "./mod.ts"; import { assertEquals, assertThrows } from "../testing/asserts.ts"; +const isCanary = /\d\.\d\.\d\+[0-9a-f]{7}/.test(Deno.version.deno); + Deno.test("[path] toFileUrl", function () { assertEquals(posix.toFileUrl("/home/foo").href, "file:///home/foo"); - assertEquals(posix.toFileUrl("/home/ ").href, "file:///home/%20"); + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertEquals(posix.toFileUrl("/home/ ").href, "file:///home/"); + } assertEquals(posix.toFileUrl("/home/%20").href, "file:///home/%2520"); assertEquals(posix.toFileUrl("/home\\foo").href, "file:///home%5Cfoo"); assertThrows( @@ -17,17 +22,23 @@ Deno.test("[path] toFileUrl", function () { TypeError, "Must be an absolute path.", ); - assertEquals( - posix.toFileUrl("//localhost/home/foo").href, - "file:////localhost/home/foo", - ); - assertEquals(posix.toFileUrl("//localhost/").href, "file:////localhost/"); - assertEquals(posix.toFileUrl("//:/home/foo").href, "file:////:/home/foo"); + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertEquals( + posix.toFileUrl("//localhost/home/foo").href, + "file:///localhost/home/foo", + ); + assertEquals(posix.toFileUrl("//localhost/").href, "file:///localhost/"); + assertEquals(posix.toFileUrl("//:/home/foo").href, "file:///:/home/foo"); + } }); Deno.test("[path] toFileUrl (win32)", function () { assertEquals(win32.toFileUrl("/home/foo").href, "file:///home/foo"); - assertEquals(win32.toFileUrl("/home/ ").href, "file:///home/%20"); + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertEquals(win32.toFileUrl("/home/ ").href, "file:///home/"); + } assertEquals(win32.toFileUrl("/home/%20").href, "file:///home/%2520"); assertEquals(win32.toFileUrl("/home\\foo").href, "file:///home/foo"); assertThrows( @@ -36,11 +47,19 @@ Deno.test("[path] toFileUrl (win32)", function () { "Must be an absolute path.", ); assertEquals(win32.toFileUrl("C:/").href, "file:///C:/"); - assertEquals( - win32.toFileUrl("//localhost/home/foo").href, - "file://localhost/home/foo", - ); - assertEquals(win32.toFileUrl("//localhost/").href, "file:////localhost/"); + // TODO(kt3k): Enable this assertion again in stable deno when 1.8.0 is landed. + if (isCanary) { + assertThrows( + () => + assertEquals( + win32.toFileUrl("//localhost/home/foo").href, + "file://localhost/home/foo", + ), + TypeError, + "Invalid hostname.", + ); + assertEquals(win32.toFileUrl("//localhost/").href, "file:///localhost/"); + } assertThrows( () => win32.toFileUrl("//:/home/foo").href, TypeError,