Skip to content

Commit 99104e1

Browse files
jkzingFishrock123
authored andcommitted
test: improve fs.exists coverage
By adding a test case using a path with illegal protocol PR-URL: #14301 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent e54f75b commit 99104e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/parallel/test-fs-exists.js

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
const common = require('../common');
2424
const assert = require('assert');
2525
const fs = require('fs');
26+
const { URL } = require('url');
2627
const f = __filename;
2728

2829
fs.exists(f, common.mustCall(function(y) {
@@ -33,5 +34,9 @@ fs.exists(`${f}-NO`, common.mustCall(function(y) {
3334
assert.strictEqual(y, false);
3435
}));
3536

37+
fs.exists(new URL('https://foo'), common.mustCall(function(y) {
38+
assert.strictEqual(y, false);
39+
}));
40+
3641
assert(fs.existsSync(f));
3742
assert(!fs.existsSync(`${f}-NO`));

0 commit comments

Comments
 (0)