Skip to content

Commit ebb5572

Browse files
TrottBethGriggs
authored andcommitted
test: replace console.error() with debuglog calls
Somehow thought I did this in 8905be2 but clearly did not. PR-URL: #32588 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
1 parent ad0f4f5 commit ebb5572

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/parallel/test-http-information-processing.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
require('../common');
33
const assert = require('assert');
44
const http = require('http');
5+
const debug = require('util').debuglog('test');
56

67
const testResBody = 'other stuff!\n';
78
const kMessageCount = 2;
89

910
const server = http.createServer((req, res) => {
1011
for (let i = 0; i < kMessageCount; i++) {
11-
console.error(`Server sending informational message #${i}...`);
12+
debug(`Server sending informational message #${i}...`);
1213
res.writeProcessing();
1314
}
14-
console.error('Server sending full response...');
15+
debug('Server sending full response...');
1516
res.writeHead(200, {
1617
'Content-Type': 'text/plain',
1718
'ABCD': '1'
@@ -25,7 +26,7 @@ server.listen(0, function() {
2526
path: '/world'
2627
});
2728
req.end();
28-
console.error('Client sending request...');
29+
debug('Client sending request...');
2930

3031
let body = '';
3132
let infoCount = 0;
@@ -40,7 +41,7 @@ server.listen(0, function() {
4041
res.setEncoding('utf8');
4142
res.on('data', function(chunk) { body += chunk; });
4243
res.on('end', function() {
43-
console.error('Got full response.');
44+
debug('Got full response.');
4445
assert.strictEqual(body, testResBody);
4546
assert.ok('abcd' in res.headers);
4647
server.close();

0 commit comments

Comments
 (0)