diff options
author | Casper Beyer <caspervonb@pm.me> | 2020-07-04 22:54:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-04 16:54:20 +0200 |
commit | fca492907cb0e6b12f202681ccf36278b5bfa81a (patch) | |
tree | 554ef601f1eeaa1814ff481fac1ae88dad4f64b6 /cli/tests/unit/real_path_test.ts | |
parent | be07aaed84946a13ec514c39606e2030e47af73f (diff) |
test(cli): enable realpath symlink tests on Windows (#6627)
Diffstat (limited to 'cli/tests/unit/real_path_test.ts')
-rw-r--r-- | cli/tests/unit/real_path_test.ts | 14 |
1 files changed, 10 insertions, 4 deletions
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<void> { @@ -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")); } ); |