node/test/parallel/test-console-async-write-error.js
Ruben Bridgewater 644fdd60d4
test: minor refactoring
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>
2018-02-16 16:54:07 +01:00

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.
}