diff options
author | DavidCai <davidcai1993@yahoo.com> | 2017-03-02 16:26:28 +0300 |
---|---|---|
committer | Italo A. Casas <me@italoacasas.com> | 2017-03-13 18:19:32 +0300 |
commit | a98d963082112637e8b50cfb65f5e644d1a7c6c8 (patch) | |
tree | b16715dc3a74bdcc8cde3082b6c4165eaf7ee14f /test | |
parent | 1af0fa4b84824e3b04c7668923365d23353c3453 (diff) |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-console-instance.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-console-instance.js b/test/parallel/test-console-instance.js index ac785e2d8c9..e74edfae2fe 100644 --- a/test/parallel/test-console-instance.js +++ b/test/parallel/test-console-instance.js @@ -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$/); |