Commit b58809ff authored by Bastien Roucariès's avatar Bastien Roucariès

Avoid buffer() warning

forwarded: https://github.com/tapjs/tap-parser/issues/62o
parent c083b61e
......@@ -323,7 +323,7 @@ class Parser extends MiniPass {
return
if (typeof encoding === 'string' && encoding !== 'utf8')
chunk = new Buffer(chunk, encoding)
chunk = new Buffer.from(chunk, encoding)
if (Buffer.isBuffer(chunk))
chunk += ''
......
......@@ -14,13 +14,13 @@ t.test('end() can take chunk', function (t) {
})
t.test('encoding', function (t) {
var p = new Parser()
p.end(new Buffer('1..0\n').toString('hex'), 'hex', t.end)
p.end(new Buffer.from('1..0\n').toString('hex'), 'hex', t.end)
})
})
t.test('takes a buffer just fine', function (t) {
var p = new Parser(theEnd)
p.write(new Buffer('TAP version 13\n'))
p.write(new Buffer.from('TAP version 13\n'))
var calledme = false
function callme () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment