summaryrefslogtreecommitdiff
path: root/test/pseudo-tty/test-tty-write-stream-resume-crash.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/pseudo-tty/test-tty-write-stream-resume-crash.js')
-rw-r--r--test/pseudo-tty/test-tty-write-stream-resume-crash.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/pseudo-tty/test-tty-write-stream-resume-crash.js b/test/pseudo-tty/test-tty-write-stream-resume-crash.js
new file mode 100644
index 0000000000..12ec1df45a
--- /dev/null
+++ b/test/pseudo-tty/test-tty-write-stream-resume-crash.js
@@ -0,0 +1,17 @@
+'use strict';
+
+const common = require('../common');
+const { WriteStream } = require('tty');
+const fd = common.getTTYfd();
+
+// Calling resume on a tty.WriteStream should be a no-op
+// Ref: https://github.com/nodejs/node/issues/21203
+
+const stream = new WriteStream(fd);
+stream.resume();
+
+stream.on('error', common.expectsError({
+ code: 'ERR_TTY_WRITABLE_NOT_READABLE',
+ type: Error,
+ message: 'The Writable side of a TTY is not Readable'
+}));