summaryrefslogtreecommitdiff
path: root/std/node
diff options
context:
space:
mode:
authorAli Hasani <a.hassssani@gmail.com>2020-05-22 22:07:25 +0430
committerGitHub <noreply@github.com>2020-05-22 13:37:25 -0400
commit1a6c5413272d110dd96fa354db28a668f55a4399 (patch)
treec783caef0ecf54e8987285ddf8658b765dc77644 /std/node
parent960f9ccb2e700332dc576163b62c518120c73f15 (diff)
re-enable symlink tests on windows (#5746)
Diffstat (limited to 'std/node')
-rw-r--r--std/node/_fs/_fs_readlink_test.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/std/node/_fs/_fs_readlink_test.ts b/std/node/_fs/_fs_readlink_test.ts
index 4b2165f8a..77ce60a3f 100644
--- a/std/node/_fs/_fs_readlink_test.ts
+++ b/std/node/_fs/_fs_readlink_test.ts
@@ -1,18 +1,20 @@
const { test } = Deno;
import { readlink, readlinkSync } from "./_fs_readlink.ts";
import { assertEquals, assert } from "../../testing/asserts.ts";
+import * as path from "../path.ts";
const testDir = Deno.makeTempDirSync();
-const oldname = testDir + "/oldname";
-const newname = testDir + "/newname";
+const oldname = path.join(testDir, "oldname");
+const newname = path.join(testDir, "newname");
-if (Deno.build.os !== "windows") {
+if (Deno.build.os === "windows") {
+ Deno.symlinkSync(oldname, newname, { type: "file" });
+} else {
Deno.symlinkSync(oldname, newname);
}
test({
name: "readlinkSuccess",
- ignore: Deno.build.os === "windows",
async fn() {
const data = await new Promise((res, rej) => {
readlink(newname, (err, data) => {
@@ -30,7 +32,6 @@ test({
test({
name: "readlinkEncodeBufferSuccess",
- ignore: Deno.build.os === "windows",
async fn() {
const data = await new Promise((res, rej) => {
readlink(newname, { encoding: "buffer" }, (err, data) => {
@@ -48,7 +49,6 @@ test({
test({
name: "readlinkSyncSuccess",
- ignore: Deno.build.os === "windows",
fn() {
const data = readlinkSync(newname);
assertEquals(typeof data, "string");
@@ -58,7 +58,6 @@ test({
test({
name: "readlinkEncodeBufferSuccess",
- ignore: Deno.build.os === "windows",
fn() {
const data = readlinkSync(newname, { encoding: "buffer" });
assert(data instanceof Uint8Array);