mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-27 23:00:25 -04:00
Replace new Buffer()
with Buffer.from()
This removes the deprecation warnings logged when tests are run.
This commit is contained in:
parent
32f87b3396
commit
3c9f7557f5
2 changed files with 2 additions and 2 deletions
test
2
test/fixtures/readProjectFile.js
vendored
2
test/fixtures/readProjectFile.js
vendored
|
@ -3,7 +3,7 @@ const fs = require('fs');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
readFileToBuffer: function (path) {
|
readFileToBuffer: function (path) {
|
||||||
return new Buffer(fs.readFileSync(path));
|
return Buffer.from(fs.readFileSync(path));
|
||||||
},
|
},
|
||||||
extractProjectJson: function (path) {
|
extractProjectJson: function (path) {
|
||||||
const zip = new AdmZip(path);
|
const zip = new AdmZip(path);
|
||||||
|
|
|
@ -13,7 +13,7 @@ const VirtualMachine = require('../../src/index');
|
||||||
|
|
||||||
const projectUri = path.resolve(__dirname, '../fixtures/offline-custom-assets.sb2');
|
const projectUri = path.resolve(__dirname, '../fixtures/offline-custom-assets.sb2');
|
||||||
const projectZip = AdmZip(projectUri);
|
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)
|
// Custom costume from sb2 file (which was downloaded from offline editor)
|
||||||
// This sound should not be available on our servers
|
// This sound should not be available on our servers
|
||||||
const costume = projectZip.readFile('1.svg');
|
const costume = projectZip.readFile('1.svg');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue