From e2fd729a0b26c299f0cc4e4618d1f97159b31a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 18 Apr 2020 22:29:39 +0200 Subject: [PATCH] fix(std): existsFile test --- std/node/_fs/_fs_exists_test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/std/node/_fs/_fs_exists_test.ts b/std/node/_fs/_fs_exists_test.ts index aaf26a0e74..fde68e717e 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));