From 8011fb34245d31cd85d806b82cf9846ddb240d35 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 fs.truncateSync() emits a deprecation warning when called with a file descriptor. Move to fs.ftruncateSync(). --- 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);