Browse Source

test: require handler to be run in sigwinch test

Use `common.mustCall()` to guarantee that the wrapped `_refreshSize()`
functions are invoked.

PR-URL: https://github.com/nodejs/node/pull/11068
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
v4.x
Rich Trott 8 years ago
committed by Myles Borins
parent
commit
50a868b3f7
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 5
      test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js

5
test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js

@ -5,7 +5,7 @@ const originalRefreshSizeStderr = process.stderr._refreshSize;
const originalRefreshSizeStdout = process.stdout._refreshSize;
const wrap = (fn, ioStream, string) => {
return () => {
const wrapped = common.mustCall(() => {
// The console.log() call prints a string that is in the .out file. In other
// words, the console.log() is part of the test, not extraneous debugging.
console.log(string);
@ -16,7 +16,8 @@ const wrap = (fn, ioStream, string) => {
if (!common.isSunOS || e.code !== 'EINVAL')
throw e;
}
};
});
return wrapped;
};
process.stderr._refreshSize = wrap(originalRefreshSizeStderr,

Loading…
Cancel
Save