diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-18 22:29:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 22:29:39 +0200 |
commit | e2fd729a0b26c299f0cc4e4618d1f97159b31a19 (patch) | |
tree | e42db62ca7873a8525c10c2aaf6497a13ad8aac5 /std/node | |
parent | ade05f3c00efc565df2380f203017ba28966c946 (diff) |
fix(std): existsFile test
Diffstat (limited to 'std/node')
-rw-r--r-- | std/node/_fs/_fs_exists_test.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/std/node/_fs/_fs_exists_test.ts b/std/node/_fs/_fs_exists_test.ts index aaf26a0e7..fde68e717 100644 --- a/std/node/_fs/_fs_exists_test.ts +++ b/std/node/_fs/_fs_exists_test.ts @@ -6,10 +6,12 @@ import { exists, existsSync } from "./_fs_exists.ts"; const { test } = Deno; test(async function existsFile() { - const availableFile = await new Promise(async (resolve) => { - const tmpFilePath = await Deno.makeTempFile(); - exists(tmpFilePath, (exists: boolean) => resolve(exists)); - Deno.remove(tmpFilePath); + const availableFile = await new Promise((resolve) => { + const tmpFilePath = Deno.makeTempFileSync(); + exists(tmpFilePath, (exists: boolean) => { + Deno.removeSync(tmpFilePath); + resolve(exists); + }); }); const notAvailableFile = await new Promise((resolve) => { exists("./notAvailable.txt", (exists: boolean) => resolve(exists)); |