mirror of
https://github.com/denoland/deno.git
synced 2024-10-29 08:58:01 -04:00
fix(std): existsFile test
This commit is contained in:
parent
ade05f3c00
commit
e2fd729a0b
1 changed files with 6 additions and 4 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue