Browse Source

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>
v6
jkzing 8 years ago
committed by Tobias Nießen
parent
commit
201e756ef1
  1. 5
      test/parallel/test-fs-exists.js

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

Loading…
Cancel
Save