aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/js/node/fs/fs.test.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/js/node/fs/fs.test.ts b/test/js/node/fs/fs.test.ts
index fac7c2b57..5cca5fce9 100644
--- a/test/js/node/fs/fs.test.ts
+++ b/test/js/node/fs/fs.test.ts
@@ -1288,6 +1288,17 @@ describe("fs.WriteStream", () => {
done();
});
});
+
+ it("should use fd if provided", () => {
+ const path = join(tmpdir(), "/not-used.txt");
+ // @ts-ignore-next-line
+ const ws = new WriteStream_(path, {
+ fd: 2,
+ });
+ // @ts-ignore-next-line
+ expect(ws.fd).toBe(2);
+ expect(existsSync(path)).toBe(false);
+ });
});
describe("fs.ReadStream", () => {
@@ -1389,6 +1400,17 @@ describe("fs.ReadStream", () => {
done();
});
});
+
+ it("should use fd if provided", () => {
+ const path = join(tmpdir(), "not-used.txt");
+ // @ts-ignore-next-line
+ const ws = new ReadStream_(path, {
+ fd: 0,
+ });
+ // @ts-ignore-next-line
+ expect(ws.fd).toBe(0);
+ expect(existsSync(path)).toBe(false);
+ });
});
describe("createWriteStream", () => {