summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-exists.js
diff options
context:
space:
mode:
authorjkzing <jingkai.zhao@foxmail.com>2017-07-16 16:59:34 +0800
committerTobias Nießen <tniessen@tnie.de>2017-07-21 15:39:27 +0200
commit201e756ef147a760064f43fd587c4467e1dbe52e (patch)
tree3445faf2fbb2b1e65823247c19d2c25c64052a53 /test/parallel/test-fs-exists.js
parent97c4033ebf2cf0e67c2ad0ad5dd50ea627d0efae (diff)
downloadandroid-node-v8-201e756ef147a760064f43fd587c4467e1dbe52e.tar.gz
android-node-v8-201e756ef147a760064f43fd587c4467e1dbe52e.tar.bz2
android-node-v8-201e756ef147a760064f43fd587c4467e1dbe52e.zip
test: improve fs.exists coverage
By adding a test case using a path with illegal protocol PR-URL: https://github.com/nodejs/node/pull/14301 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-exists.js')
-rw-r--r--test/parallel/test-fs-exists.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/parallel/test-fs-exists.js b/test/parallel/test-fs-exists.js
index 071f85fc81..b19aa38774 100644
--- a/test/parallel/test-fs-exists.js
+++ b/test/parallel/test-fs-exists.js
@@ -23,6 +23,7 @@
const common = require('../common');
const assert = require('assert');
const fs = require('fs');
+const { URL } = require('url');
const f = __filename;
fs.exists(f, common.mustCall(function(y) {
@@ -33,5 +34,9 @@ fs.exists(`${f}-NO`, common.mustCall(function(y) {
assert.strictEqual(y, false);
}));
+fs.exists(new URL('https://foo'), common.mustCall(function(y) {
+ assert.strictEqual(y, false);
+}));
+
assert(fs.existsSync(f));
assert(!fs.existsSync(`${f}-NO`));