diff options
author | Chris Knight <cknight1234@gmail.com> | 2020-03-15 15:48:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-15 11:48:46 -0400 |
commit | 620dd9724d4f8568efebb1642b49c653de9424cd (patch) | |
tree | e57827e536c264189f151ffebffe7e9faaae0c46 /std/node/_fs/_fs_chmod_test.ts | |
parent | dc6e0c3591709d6f8887bb672af1de54dfc8a974 (diff) |
refactor: move existing fs implementation to internal _fs directory (#4381)
Diffstat (limited to 'std/node/_fs/_fs_chmod_test.ts')
-rw-r--r-- | std/node/_fs/_fs_chmod_test.ts | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/std/node/_fs/_fs_chmod_test.ts b/std/node/_fs/_fs_chmod_test.ts index 42c29cdc8..de8d1cce8 100644 --- a/std/node/_fs/_fs_chmod_test.ts +++ b/std/node/_fs/_fs_chmod_test.ts @@ -4,41 +4,8 @@ import { fail, assert } from "../../testing/asserts.ts"; import { chmod, chmodSync } from "./_fs_chmod.ts"; test({ - name: "ASYNC: Error passed in callback function when bad mode passed in", - async fn() { - await new Promise((resolve, reject) => { - chmod("some_pretend_file.txt", "999", err => { - if (err) reject(err); - else resolve(); - }); - }) - .then(() => { - fail("Expected exception to be thrown"); - }) - .catch(err => { - assert(err); - }); - } -}); - -test({ - name: "SYNC: Error thrown when bad mode passed in", - fn() { - let caughtError: Error | undefined; - try { - chmodSync("some_pretend_file.txt", "999"); - } catch (err) { - caughtError = err; - } - assert(caughtError); - } -}); - -const skip = Deno.build.os == "win"; - -test({ - skip, name: "ASYNC: Permissions are changed (non-Windows)", + skip: Deno.build.os === "win", async fn() { const tempFile: string = await Deno.makeTempFile(); const originalFileMode: number | null = (await Deno.lstat(tempFile)).mode; @@ -63,8 +30,8 @@ test({ }); test({ - skip, name: "SYNC: Permissions are changed (non-Windows)", + skip: Deno.build.os === "win", fn() { const tempFile: string = Deno.makeTempFileSync(); const originalFileMode: number | null = Deno.lstatSync(tempFile).mode; |