From e52512cedbd72a0be48c2a02ea30753fb964c854 Mon Sep 17 00:00:00 2001 From: 2Pacalypse- Date: Mon, 12 Jun 2017 22:12:06 +0200 Subject: [PATCH] Adjust the test for arrays of buffers to work across all node versions. --- test/unit/utils-tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/utils-tests.js b/test/unit/utils-tests.js index 685b59e..19c0b8d 100644 --- a/test/unit/utils-tests.js +++ b/test/unit/utils-tests.js @@ -127,8 +127,8 @@ test('prepareValue: date array prepared properly', function() { }); test('prepareValue: buffer array prepared properly', function() { - var buffer1 = Buffer.from('dead', 'hex'); - var buffer2 = Buffer.from('beef', 'hex'); + var buffer1 = Buffer.from ? Buffer.from('dead', 'hex') : new Buffer('dead', 'hex'); + var buffer2 = Buffer.from ? Buffer.from('beef', 'hex') : new Buffer('beef', 'hex'); var out = utils.prepareValue([buffer1, buffer2]); assert.strictEqual(out, '{\\\\xdead,\\\\xbeef}'); });