diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index 2843e9c9db727a..26923df0045a42 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -310,12 +310,12 @@ assert.strictEqual('TWFu', (Buffer.from('Man')).toString('base64')); assert.strictEqual(quote, b.toString('ascii', 0, quote.length)); // check that the base64 decoder ignores whitespace - const expectedWhite = expected.slice(0, 60) + ' \n' + - expected.slice(60, 120) + ' \n' + - expected.slice(120, 180) + ' \n' + - expected.slice(180, 240) + ' \n' + - expected.slice(240, 300) + '\n' + - expected.slice(300, 360) + '\n'; + const expectedWhite = `${expected.slice(0, 60)} \n` + + `${expected.slice(60, 120)} \n` + + `${expected.slice(120, 180)} \n` + + `${expected.slice(180, 240)} \n` + + `${expected.slice(240, 300)}\n` + + `${expected.slice(300, 360)}\n`; b = Buffer.allocUnsafe(1024); bytesWritten = b.write(expectedWhite, 0, 'base64'); assert.strictEqual(quote.length, bytesWritten);