Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: label the actual and expected value correctly in test-http-stat…
…us-message.js

Fixed the order of the function parameters given to assert.strictEqual(). When there is an assertion error, the actual and expected value is labeled correctly.
  • Loading branch information
fastereder committed Oct 12, 2018
commit e2425de1bb0e2f1d1a6deaf603f48d921155170f
16 changes: 10 additions & 6 deletions test/parallel/test-http-status-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,22 @@ const s = http.createServer(function(req, res) {

s.listen(0, test);


function test() {
const bufs = [];
const client = net.connect(this.address().port, function() {
client.write('GET / HTTP/1.1\r\nConnection: close\r\n\r\n');
});
const client = net.connect(
this.address().port,
function() {
client.write('GET / HTTP/1.1\r\nConnection: close\r\n\r\n');
}
);
client.on('data', function(chunk) {
bufs.push(chunk);
});
client.on('end', function() {
const head = Buffer.concat(bufs).toString('latin1').split('\r\n')[0];
assert.strictEqual('HTTP/1.1 200 Custom Message', head);
const head = Buffer.concat(bufs)
.toString('latin1')
.split('\r\n')[0];
assert.strictEqual(head, 'HTTP/1.1 200 Custom Message');
console.log('ok');
s.close();
});
Expand Down