mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
test: address deprecation warning
fs.truncateSync() emits a deprecation warning when called with a file descriptor. Move to fs.ftruncateSync(). PR-URL: https://github.com/nodejs/node/pull/38448 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
1 parent
8258799472
commit
fdfb39e692
1 file changed
+1
-1
@@ -34,7 +34,7 @@ const fd = fs.openSync(filepath, 'w+');
|
||||
const offset = 5 * 1024 * 1024 * 1024; // 5GB
|
||||
const message = 'Large File';
|
||||
|
||||
fs.truncateSync(fd, offset);
|
||||
fs.ftruncateSync(fd, offset);
|
||||
assert.strictEqual(fs.statSync(filepath).size, offset);
|
||||
const writeBuf = Buffer.from(message);
|
||||
fs.writeSync(fd, writeBuf, 0, writeBuf.length, offset);
|
||||
|
||||
Reference in new issue
Block a user