From fca492907cb0e6b12f202681ccf36278b5bfa81a Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Sat, 4 Jul 2020 22:54:20 +0800 Subject: test(cli): enable realpath symlink tests on Windows (#6627) --- cli/tests/unit/real_path_test.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'cli/tests/unit/real_path_test.ts') diff --git a/cli/tests/unit/real_path_test.ts b/cli/tests/unit/real_path_test.ts index 319e3f0d8..6e754e3ee 100644 --- a/cli/tests/unit/real_path_test.ts +++ b/cli/tests/unit/real_path_test.ts @@ -19,7 +19,6 @@ unitTest({ perms: { read: true } }, function realPathSyncSuccess(): void { unitTest( { - ignore: Deno.build.os === "windows", perms: { read: true, write: true }, }, function realPathSyncSymlink(): void { @@ -29,7 +28,11 @@ unitTest( Deno.mkdirSync(target); Deno.symlinkSync(target, symlink); const targetPath = Deno.realPathSync(symlink); - assert(targetPath.startsWith("/")); + if (Deno.build.os !== "windows") { + assert(targetPath.startsWith("/")); + } else { + assert(/^[A-Z]/.test(targetPath)); + } assert(targetPath.endsWith("/target")); } ); @@ -61,7 +64,6 @@ unitTest({ perms: { read: true } }, async function realPathSuccess(): Promise< unitTest( { - ignore: Deno.build.os === "windows", perms: { read: true, write: true }, }, async function realPathSymlink(): Promise { @@ -71,7 +73,11 @@ unitTest( Deno.mkdirSync(target); Deno.symlinkSync(target, symlink); const targetPath = await Deno.realPath(symlink); - assert(targetPath.startsWith("/")); + if (Deno.build.os !== "windows") { + assert(targetPath.startsWith("/")); + } else { + assert(/^[A-Z]/.test(targetPath)); + } assert(targetPath.endsWith("/target")); } ); -- cgit v1.2.3