mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
fix(ext/node): deno test
This commit is contained in:
parent
27adf4c797
commit
e250b23b73
1 changed files with 17 additions and 0 deletions
|
@ -300,3 +300,20 @@ Deno.test({
|
||||||
await fileHandle.close();
|
await fileHandle.close();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Deno.test({
|
||||||
|
name:
|
||||||
|
"[node/fs filehandle.sync] Request that all data for the open file descriptor is flushed to the storage device",
|
||||||
|
async fn() {
|
||||||
|
const fileHandle = await fs.open(testData, "r+");
|
||||||
|
|
||||||
|
await fileHandle.datasync();
|
||||||
|
await fileHandle.sync();
|
||||||
|
const buf = Buffer.from("hello world");
|
||||||
|
await fileHandle.write(buf);
|
||||||
|
const ret = await fileHandle.read(Buffer.alloc(11), 0, 11, 0);
|
||||||
|
assertEquals(ret.bytesRead, 11);
|
||||||
|
assertEquals(ret.buffer, buf);
|
||||||
|
await fileHandle.close();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue