aboutsummaryrefslogtreecommitdiff
path: root/test/js
diff options
context:
space:
mode:
Diffstat (limited to 'test/js')
-rw-r--r--test/js/node/fs/fs.test.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/js/node/fs/fs.test.ts b/test/js/node/fs/fs.test.ts
index 41275edd5..3e030f609 100644
--- a/test/js/node/fs/fs.test.ts
+++ b/test/js/node/fs/fs.test.ts
@@ -953,6 +953,23 @@ describe("stat", () => {
} catch (e: any) {
expect(e.code).toBe("ENOENT");
}
+
+ try {
+ statSync("");
+ throw "statSync should throw";
+ } catch (e: any) {
+ expect(e.code).toBe("ENOENT");
+ }
+ });
+});
+
+describe("exist", () => {
+ it("should return false with invalid path", () => {
+ expect(existsSync("/pathNotExist")).toBe(false);
+ });
+
+ it("should return false with empty string", () => {
+ expect(existsSync("")).toBe(false);
});
});