Skip to content

Commit a98d963

Browse files
DavidCai1111italoacasas
authored andcommitted
test: increase coverage of console
PR-URL: #11653 Reviewed-By: Claudio Rodriguez <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent 1af0fa4 commit a98d963

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/parallel/test-console-instance.js

+10
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,13 @@ out.write = common.mustCall((d) => {
5757
assert.doesNotThrow(() => {
5858
Console(out, err);
5959
});
60+
61+
// Instance that does not ignore the stream errors.
62+
const c2 = new Console(out, err, false);
63+
64+
out.write = () => { throw new Error('out'); };
65+
err.write = () => { throw new Error('err'); };
66+
67+
assert.throws(() => c2.log('foo'), /^Error: out$/);
68+
assert.throws(() => c2.warn('foo'), /^Error: err$/);
69+
assert.throws(() => c2.dir('foo'), /^Error: out$/);

0 commit comments

Comments
 (0)