Skip to content

Commit e0df11a

Browse files
committed
Use modes that windows can handle
1 parent b0330c8 commit e0df11a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/unit_node/_fs/_fs_handle_test.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,16 @@ Deno.test(
200200
},
201201
);
202202

203-
Deno.test("chmod", async function () {
203+
Deno.test("[node/fs filehandle.chmod] Change the permissions of the file", async function () {
204204
const fileHandle = await fs.open(testData);
205-
await fileHandle.chmod(0o666);
206-
const info1 = await Deno.stat(testData);
207-
assertEquals(info1.mode?.toString(8), `100666`);
208-
await fileHandle.chmod(0o600);
209-
const info2 = await Deno.stat(testData);
210-
assertEquals(info2.mode?.toString(8), `100600`);
205+
206+
const readOnly = 0o400;
207+
await fileHandle.chmod(readOnly.toString(8));
208+
assertEquals(Deno.statSync(testData).mode! & 0o777, readOnly);
209+
210+
const readWrite = 0o600;
211+
await fileHandle.chmod(readWrite.toString(8));
212+
assertEquals(Deno.statSync(testData).mode! & 0o777, readWrite);
213+
211214
await fileHandle.close();
212215
});

0 commit comments

Comments
 (0)