summaryrefslogtreecommitdiff
path: root/std/node
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-04-18 22:29:39 +0200
committerGitHub <noreply@github.com>2020-04-18 22:29:39 +0200
commite2fd729a0b26c299f0cc4e4618d1f97159b31a19 (patch)
treee42db62ca7873a8525c10c2aaf6497a13ad8aac5 /std/node
parentade05f3c00efc565df2380f203017ba28966c946 (diff)
fix(std): existsFile test
Diffstat (limited to 'std/node')
-rw-r--r--std/node/_fs/_fs_exists_test.ts10
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));