summaryrefslogtreecommitdiff
path: root/std/fs/testdata/exists.ts
diff options
context:
space:
mode:
authorAxetroy <axetroy.dev@gmail.com>2019-12-13 22:47:09 +0800
committerRy Dahl <ry@tinyclouds.org>2019-12-13 22:47:09 +0800
commit8cf8a29d35d5832230034b3f9f6ce3cc67dba7c1 (patch)
tree8103652192c652da7389d8551b86f99eb4624bfb /std/fs/testdata/exists.ts
parentdf7d8288d984f703722fae161b7d32fae9ab3149 (diff)
fix permission errors are swallowed by fs.exists (#3493)
Diffstat (limited to 'std/fs/testdata/exists.ts')
-rw-r--r--std/fs/testdata/exists.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/std/fs/testdata/exists.ts b/std/fs/testdata/exists.ts
new file mode 100644
index 000000000..aee8574d8
--- /dev/null
+++ b/std/fs/testdata/exists.ts
@@ -0,0 +1,10 @@
+import { exists } from "../exists.ts";
+
+exists(Deno.args[1])
+ .then(isExist => {
+ Deno.stdout.write(new TextEncoder().encode(isExist ? 'exist' :'not exist'))
+ })
+ .catch((err) => {
+ Deno.stdout.write(new TextEncoder().encode(err.message))
+ })
+