Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-console-instance.js10
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$/);