Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: replace console.error() with debuglog calls #32588

Merged
merged 1 commit into from
Apr 3, 2020
Merged
Changes from all commits
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
9 changes: 5 additions & 4 deletions test/parallel/test-http-information-processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
require('../common');
const assert = require('assert');
const http = require('http');
const debug = require('util').debuglog('test');

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

const server = http.createServer((req, res) => {
for (let i = 0; i < kMessageCount; i++) {
console.error(`Server sending informational message #${i}...`);
debug(`Server sending informational message #${i}...`);
res.writeProcessing();
}
console.error('Server sending full response...');
debug('Server sending full response...');
res.writeHead(200, {
'Content-Type': 'text/plain',
'ABCD': '1'
Expand All @@ -25,7 +26,7 @@ server.listen(0, function() {
path: '/world'
});
req.end();
console.error('Client sending request...');
debug('Client sending request...');

let body = '';
let infoCount = 0;
Expand All @@ -40,7 +41,7 @@ server.listen(0, function() {
res.setEncoding('utf8');
res.on('data', function(chunk) { body += chunk; });
res.on('end', function() {
console.error('Got full response.');
debug('Got full response.');
assert.strictEqual(body, testResBody);
assert.ok('abcd' in res.headers);
server.close();
Expand Down