diff --git a/package.json b/package.json index 66b3ab94f..4c3d66b5c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "repository": "https://github.com/gruntjs/grunt.git", "license": "MIT", "engines": { - "node": ">=10" + "node": ">=8" }, "scripts": { "test": "node bin/grunt test", diff --git a/test/fixtures/spawn-multibyte.js b/test/fixtures/spawn-multibyte.js index 8277711f6..b592341c6 100644 --- a/test/fixtures/spawn-multibyte.js +++ b/test/fixtures/spawn-multibyte.js @@ -4,7 +4,7 @@ // A multibyte buffer containing all our output. We will slice it later. // In this case we are using a Japanese word for hello / good day, where each // character takes three bytes. -var fullOutput = new Buffer('こんにちは'); +var fullOutput = Buffer.from('こんにちは'); // Output one full character and one third of a character process.stdout.write(fullOutput.slice(0, 4)); diff --git a/test/grunt/config_test.js b/test/grunt/config_test.js index 6da5422e2..e2db6cf12 100644 --- a/test/grunt/config_test.js +++ b/test/grunt/config_test.js @@ -18,7 +18,7 @@ exports.config = { bar: 'bar', arr: ['foo', '<%= obj.foo2 %>'], arr2: ['<%= arr %>', '<%= obj.Arr %>'], - buffer: new Buffer('test'), + buffer: Buffer.from('test'), }); done(); }, @@ -57,7 +57,7 @@ exports.config = { test.deepEqual(grunt.config.process(['<%= arr %>', '<%= obj.Arr %>']), [['foo', 'bar'], ['foo', 'bar']], 'Should expand <%= arr %> and <%= obj.Arr %> values as objects if possible.'); var buf = grunt.config.process('<%= buffer %>'); test.ok(Buffer.isBuffer(buf), 'Should retrieve Buffer instances as Buffer.'); - test.deepEqual(buf, new Buffer('test'), 'Should return buffers as-is.'); + test.deepEqual(buf, Buffer.from('test'), 'Should return buffers as-is.'); test.done(); }, 'config.get': function(test) { @@ -72,7 +72,7 @@ exports.config = { test.deepEqual(grunt.config.get(['obj', 'arr2']), [['foo', 'bar'], ['foo', 'bar']], 'Should expand <%= arr %> and <%= obj.Arr %> values as objects if possible.'); var buf = grunt.config.get('buffer'); test.ok(Buffer.isBuffer(buf), 'Should retrieve Buffer instances as Buffer.'); - test.deepEqual(buf, new Buffer('test'), 'Should return buffers as-is.'); + test.deepEqual(buf, Buffer.from('test'), 'Should return buffers as-is.'); test.done(); }, 'config.set': function(test) { diff --git a/test/grunt/file_test.js b/test/grunt/file_test.js index 19889e61c..26ebcbe2e 100644 --- a/test/grunt/file_test.js +++ b/test/grunt/file_test.js @@ -567,7 +567,7 @@ exports.file = { encoding: null, process: function(src) { test.ok(Buffer.isBuffer(src), 'when encoding is specified as null, process src as a buffer'); - return new Buffer('føø' + src.toString() + 'bår'); + return Buffer.from('føø' + src.toString() + 'bår'); } }); test.equal(grunt.file.read(tmpfile.path), 'føø' + this.string + 'bår', 'file should be saved as the buffer returned by process.');