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));