From 57ae8305dca1862b36d2f13d72f018d269506662 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 3 May 2019 11:58:19 -0700 Subject: [PATCH] test: remove use of deprecated Buffer --- test/test-core.js | 2 +- test/test-syslog.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test-core.js b/test/test-core.js index cc263db..d3e1ddc 100644 --- a/test/test-core.js +++ b/test/test-core.js @@ -39,7 +39,7 @@ function accept(m) { } accept('string'); -accept(Buffer('buffer')); +accept(Buffer.from('buffer')); accept(undefined); accept(null); accept({some: 5}); diff --git a/test/test-syslog.js b/test/test-syslog.js index d7b9dc2..4b99fa2 100644 --- a/test/test-syslog.js +++ b/test/test-syslog.js @@ -39,7 +39,7 @@ function expect(l, m) { currentMask, ++count, l, Buffer.isBuffer(m) ? 'buf' : 'str'); if (Buffer.isBuffer(m)) { - m = Buffer(prefix + m); + m = Buffer.from(prefix + m); } else { m = prefix + m; } @@ -62,9 +62,9 @@ function masked(l, m) { setmask(0xff); expect('LOG_CRIT', 'message'); -expect('LOG_CRIT', Buffer('message')); +expect('LOG_CRIT', Buffer.from('message')); expect(l.LOG_CRIT, 'message'); -expect(l.LOG_CRIT, Buffer('message')); +expect(l.LOG_CRIT, Buffer.from('message')); expect(l.LOG_DEBUG, 'debug'); setmask(syslog.logUpto('LOG_INFO'));