We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7505b86 commit 7020e9fCopy full SHA for 7020e9f
2 files changed
test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js
@@ -0,0 +1,29 @@
1
+'use strict';
2
+const common = require('../common');
3
+
4
+const originalRefreshSizeStderr = process.stderr._refreshSize;
5
+const originalRefreshSizeStdout = process.stdout._refreshSize;
6
7
+const wrap = (fn, ioStream, string) => {
8
+ return () => {
9
+ // The console.log() call prints a string that is in the .out file. In other
10
+ // words, the console.log() is part of the test, not extraneous debugging.
11
+ console.log(string);
12
+ try {
13
+ fn.call(ioStream);
14
+ } catch (e) {
15
+ // EINVAL happens on SmartOS if emulation is incomplete
16
+ if (!common.isSunOS || e.code !== 'EINVAL')
17
+ throw e;
18
+ }
19
+ };
20
+};
21
22
+process.stderr._refreshSize = wrap(originalRefreshSizeStderr,
23
+ process.stderr,
24
+ 'calling stderr._refreshSize');
25
+process.stdout._refreshSize = wrap(originalRefreshSizeStdout,
26
+ process.stdout,
27
+ 'calling stdout._refreshSize');
28
29
+process.emit('SIGWINCH');
test/pseudo-tty/test-stderr-stdout-handle-sigwinch.out
@@ -0,0 +1,2 @@
+calling stdout._refreshSize
+calling stderr._refreshSize
0 commit comments