mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: increase coverage of console
PR-URL: https://github.com/nodejs/node/pull/11653 Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This commit is contained in:
1 parent
dd76f5f661
commit
74bd3144d6
1 file changed
+10
@@ -57,3 +57,13 @@ out.write = common.mustCall((d) => {
|
||||
assert.doesNotThrow(() => {
|
||||
Console(out, err);
|
||||
});
|
||||
|
||||
// Instance that does not ignore the stream errors.
|
||||
const c2 = new Console(out, err, false);
|
||||
|
||||
out.write = () => { throw new Error('out'); };
|
||||
err.write = () => { throw new Error('err'); };
|
||||
|
||||
assert.throws(() => c2.log('foo'), /^Error: out$/);
|
||||
assert.throws(() => c2.warn('foo'), /^Error: err$/);
|
||||
assert.throws(() => c2.dir('foo'), /^Error: out$/);
|
||||
Reference in new issue
Block a user