From fdfb39e6928dea431c815367bfbaf93e50610b7b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 27 Apr 2021 23:11:22 -0700 Subject: [PATCH] test: address deprecation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat --- test/pummel/test-fs-largefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pummel/test-fs-largefile.js b/test/pummel/test-fs-largefile.js index 409d7a2112f027..9c2b26782d9c96 100644 --- a/test/pummel/test-fs-largefile.js +++ b/test/pummel/test-fs-largefile.js @@ -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);