diff options
author | Nayeem Rahman <muhammed.9939@gmail.com> | 2020-03-15 12:03:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-15 13:03:25 +0100 |
commit | 6471d4cfabf27c0f5e7b340568aa88712d270541 (patch) | |
tree | 29ca29b6baeb4715a0b7eeb24aeaf8b0ed112e97 /std/node/fs_test.ts | |
parent | 2f4be6e9441c7d5b0afd0d37dccd48d3057bcd3f (diff) |
refactor(std): Uncomment disabled tests, use skip option (#4378)
Diffstat (limited to 'std/node/fs_test.ts')
-rwxr-xr-x | std/node/fs_test.ts | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/std/node/fs_test.ts b/std/node/fs_test.ts index 9753d9520..96d0f6597 100755 --- a/std/node/fs_test.ts +++ b/std/node/fs_test.ts @@ -50,9 +50,16 @@ test(function readFileEncodeUtf8Success() { }); // Just for now, until we implement symlink for Windows. -if (Deno.build.os !== "win") { +const skip = Deno.build.os == "win"; + +if (!skip) { Deno.symlinkSync(oldname, newname); - test(async function readlinkSuccess() { +} + +test({ + skip, + name: "readlinkSuccess", + async fn() { const data = await new Promise((res, rej) => { readlink(newname, (err, data) => { if (err) { @@ -64,9 +71,13 @@ if (Deno.build.os !== "win") { assertEquals(typeof data, "string"); assertEquals(data as string, oldname); - }); + } +}); - test(async function readlinkEncodeBufferSuccess() { +test({ + skip, + name: "readlinkEncodeBufferSuccess", + async fn() { const data = await new Promise((res, rej) => { readlink(newname, { encoding: "buffer" }, (err, data) => { if (err) { @@ -78,17 +89,25 @@ if (Deno.build.os !== "win") { assert(data instanceof Uint8Array); assertEquals(new TextDecoder().decode(data as Uint8Array), oldname); - }); + } +}); - test(function readlinkSyncSuccess() { +test({ + skip, + name: "readlinkSyncSuccess", + fn() { const data = readlinkSync(newname); assertEquals(typeof data, "string"); assertEquals(data as string, oldname); - }); + } +}); - test(function readlinkEncodeBufferSuccess() { +test({ + skip, + name: "readlinkEncodeBufferSuccess", + fn() { const data = readlinkSync(newname, { encoding: "buffer" }); assert(data instanceof Uint8Array); assertEquals(new TextDecoder().decode(data as Uint8Array), oldname); - }); -} + } +}); |