summaryrefslogtreecommitdiff
path: root/tests/unit_node
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_node')
-rw-r--r--tests/unit_node/fs_test.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit_node/fs_test.ts b/tests/unit_node/fs_test.ts
index b1f7c53e8..2d1465aec 100644
--- a/tests/unit_node/fs_test.ts
+++ b/tests/unit_node/fs_test.ts
@@ -4,13 +4,16 @@ import { assert, assertEquals, assertThrows } from "@std/assert";
import { join } from "node:path";
import { tmpdir } from "node:os";
import {
+ closeSync,
constants,
createWriteStream,
existsSync,
lstatSync,
mkdtempSync,
+ openSync,
promises,
readFileSync,
+ readSync,
Stats,
statSync,
writeFileSync,
@@ -201,3 +204,11 @@ Deno.test(
assertEquals(res, [0, 1, 2, 3, 4, 5]);
},
);
+
+Deno.test("[node/fs] readSync works", () => {
+ const fd = openSync("tests/testdata/assets/hello.txt", "r");
+ const buf = new Uint8Array(256);
+ const bytesRead = readSync(fd!, buf);
+ assertEquals(bytesRead, 12);
+ closeSync(fd!);
+});