summaryrefslogtreecommitdiff
path: root/tests/unit_node/fs_test.ts
diff options
context:
space:
mode:
authorMarvin Hagemeister <marvin@deno.com>2024-05-28 12:24:54 +0200
committerGitHub <noreply@github.com>2024-05-28 12:24:54 +0200
commita0ddf7305895e2920ef5d9208fc9ec767ebb11d5 (patch)
tree691145ccdb10118be3e2ce9cf2f42a4988dc7133 /tests/unit_node/fs_test.ts
parent53606de6344fca63c40fde37056910b72a3c4f8d (diff)
fix(ext/node): add `throwIfNoEntry` option in `fs.lstatSync` (#24006)
We didn't support the `throwIfNoEntry` option for Node's `fs.lstatSync` method. Note that the async variant doesn't have this option. Fixes https://github.com/denoland/deno/issues/23996
Diffstat (limited to 'tests/unit_node/fs_test.ts')
-rw-r--r--tests/unit_node/fs_test.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unit_node/fs_test.ts b/tests/unit_node/fs_test.ts
index e62a246fa..a241189a5 100644
--- a/tests/unit_node/fs_test.ts
+++ b/tests/unit_node/fs_test.ts
@@ -7,6 +7,7 @@ import {
constants,
createWriteStream,
existsSync,
+ lstatSync,
mkdtempSync,
promises,
readFileSync,
@@ -156,3 +157,11 @@ Deno.test("[node/fs createWriteStream", async () => {
await Deno.remove(tempDir, { recursive: true });
}
});
+
+Deno.test(
+ "[node/fs lstatSync] supports throwIfNoEntry option",
+ () => {
+ const result = lstatSync("non-existing-path", { throwIfNoEntry: false });
+ assertEquals(result, undefined);
+ },
+);