From 3c9f7557f535d87650dda99a92a07dce8d00c474 Mon Sep 17 00:00:00 2001 From: adroitwhiz <adroitwhiz@protonmail.com> Date: Sun, 7 Mar 2021 16:21:06 -0500 Subject: [PATCH] Replace `new Buffer()` with `Buffer.from()` This removes the deprecation warnings logged when tests are run. --- test/fixtures/readProjectFile.js | 2 +- test/integration/offline-custom-assets.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fixtures/readProjectFile.js b/test/fixtures/readProjectFile.js index 29775c9ee..8340ba228 100644 --- a/test/fixtures/readProjectFile.js +++ b/test/fixtures/readProjectFile.js @@ -3,7 +3,7 @@ const fs = require('fs'); module.exports = { readFileToBuffer: function (path) { - return new Buffer(fs.readFileSync(path)); + return Buffer.from(fs.readFileSync(path)); }, extractProjectJson: function (path) { const zip = new AdmZip(path); diff --git a/test/integration/offline-custom-assets.js b/test/integration/offline-custom-assets.js index c67deb852..8e8ed59e2 100644 --- a/test/integration/offline-custom-assets.js +++ b/test/integration/offline-custom-assets.js @@ -13,7 +13,7 @@ const VirtualMachine = require('../../src/index'); const projectUri = path.resolve(__dirname, '../fixtures/offline-custom-assets.sb2'); const projectZip = AdmZip(projectUri); -const project = new Buffer(fs.readFileSync(projectUri)); +const project = Buffer.from(fs.readFileSync(projectUri)); // Custom costume from sb2 file (which was downloaded from offline editor) // This sound should not be available on our servers const costume = projectZip.readFile('1.svg');