test: fix strictEqual argument order
PR-URL: https://github.com/nodejs/node/pull/23490 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
61f5543e5b
commit
fd289959c8
@ -33,18 +33,22 @@ const s = http.createServer(function(req, res) {
|
|||||||
|
|
||||||
s.listen(0, test);
|
s.listen(0, test);
|
||||||
|
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
const bufs = [];
|
const bufs = [];
|
||||||
const client = net.connect(this.address().port, function() {
|
const client = net.connect(
|
||||||
|
this.address().port,
|
||||||
|
function() {
|
||||||
client.write('GET / HTTP/1.1\r\nConnection: close\r\n\r\n');
|
client.write('GET / HTTP/1.1\r\nConnection: close\r\n\r\n');
|
||||||
});
|
}
|
||||||
|
);
|
||||||
client.on('data', function(chunk) {
|
client.on('data', function(chunk) {
|
||||||
bufs.push(chunk);
|
bufs.push(chunk);
|
||||||
});
|
});
|
||||||
client.on('end', function() {
|
client.on('end', function() {
|
||||||
const head = Buffer.concat(bufs).toString('latin1').split('\r\n')[0];
|
const head = Buffer.concat(bufs)
|
||||||
assert.strictEqual('HTTP/1.1 200 Custom Message', head);
|
.toString('latin1')
|
||||||
|
.split('\r\n')[0];
|
||||||
|
assert.strictEqual(head, 'HTTP/1.1 200 Custom Message');
|
||||||
console.log('ok');
|
console.log('ok');
|
||||||
s.close();
|
s.close();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user