summaryrefslogtreecommitdiff
path: root/test/parallel/test-console-async-write-error.js
blob: 0fcd72868ab090b847c8ac2b3610294c6db542bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict';
const common = require('../common');
const { Console } = require('console');
const { Writable } = require('stream');
const assert = require('assert');

const out = new Writable({
  write: common.mustCall((chunk, enc, callback) => {
    process.nextTick(callback, new Error('foobar'));
  })
});

const c = new Console(out, out, true);

assert.doesNotThrow(() => {
  c.log('abc');
});