Skip to content

Commit

Permalink
test: increase coverage of console
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
DavidCai1111 authored and MylesBorins committed Apr 19, 2017
1 parent 4befdd1 commit 5a93eab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/parallel/test-console-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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$/);

0 comments on commit 5a93eab

Please sign in to comment.