From 3c5725e7af9452f383f39b4f53b5908805e095b6 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 14 Feb 2019 21:07:43 -0800 Subject: [PATCH] [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 --- test/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils.js b/test/utils.js index 259c5ad9..da31ce53 100644 --- a/test/utils.js +++ b/test/utils.js @@ -130,7 +130,7 @@ test('isBuffer()', function (t) { var saferBuffer = SaferBuffer.from('abc'); t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); - var buffer = Buffer.from('abc'); + var buffer = Buffer.from ? Buffer.from('abc') : new Buffer('abc'); t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer'); t.end(); });