mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
644fdd60d4
Add punctuation and comments about code that should not throw. Also remove a obsolete test and refactor some tests. PR-URL: https://github.com/nodejs/node/pull/18669 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
16 lines
416 B
JavaScript
16 lines
416 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const { Console } = require('console');
|
|
const { Writable } = require('stream');
|
|
|
|
for (const method of ['dir', 'log', 'warn']) {
|
|
const out = new Writable({
|
|
write: common.mustCall((chunk, enc, callback) => {
|
|
process.nextTick(callback, new Error('foobar'));
|
|
})
|
|
});
|
|
|
|
const c = new Console(out, out, true);
|
|
c[method]('abc'); // Should not throw.
|
|
}
|