summaryrefslogtreecommitdiff
path: root/std/node/_fs/_fs_exists_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/node/_fs/_fs_exists_test.ts')
-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));