1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

test(cli): enable realpath symlink tests on Windows (#6627)

This commit is contained in:
Casper Beyer 2020-07-04 22:54:20 +08:00 committed by GitHub
parent be07aaed84
commit fca492907c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"));
}
);