Do not use deprecated Buffer constructor

This commit is contained in:
Daniel García Aubert
2018-11-07 15:06:38 +01:00
parent de47558628
commit d55dbe70d5
3 changed files with 6 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ var testRange = function(top) {
var txt = 'COPY numbers FROM STDIN'
var stream = fromClient.query(copy(txt))
for(var i = 0; i < top; i++) {
stream.write(Buffer('' + i + '\t' + i*10 + '\n'))
stream.write(Buffer.from('' + i + '\t' + i*10 + '\n'))
}
stream.end()
var countDone = gonna('have correct count')
@@ -69,7 +69,7 @@ var testSingleEnd = function() {
assert(count==1, '`end` Event was triggered ' + count + ' times');
if (count == 1) fromClient.end();
})
stream.end(Buffer('1\n'))
stream.end(Buffer.from('1\n'))
}
testSingleEnd()

View File

@@ -31,7 +31,7 @@ var testComparators = function() {
assert(copy1._gotCopyOutResponse, 'should have received CopyOutResponse')
assert(!copy1._remainder, 'Message with no additional data (len=Int4Len+0) should not leave a remainder')
}))
copy1.end(new Buffer([code.CopyOutResponse, 0x00, 0x00, 0x00, 0x04]));
copy1.end(Buffer.from([code.CopyOutResponse, 0x00, 0x00, 0x00, 0x04]));
}