aboutsummaryrefslogtreecommitdiff
path: root/test/js/node/fs/fs.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/js/node/fs/fs.test.ts')
-rw-r--r--test/js/node/fs/fs.test.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/js/node/fs/fs.test.ts b/test/js/node/fs/fs.test.ts
index 9eb4399b3..e9cafe957 100644
--- a/test/js/node/fs/fs.test.ts
+++ b/test/js/node/fs/fs.test.ts
@@ -1159,3 +1159,10 @@ it("repro 1516: can use undefined/null to specify default flag", () => {
expect(readFileSync(path, { encoding: "utf8", flag: null })).toBe("b");
rmSync(path);
});
+
+it("existsSync with invalid path doesn't throw", () => {
+ expect(existsSync(null as any)).toBe(false);
+ expect(existsSync(123 as any)).toBe(false);
+ expect(existsSync(undefined as any)).toBe(false);
+ expect(existsSync({ invalid: 1 } as any)).toBe(false);
+});