Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: require handler to be run in sigwinch test
Use `common.mustCall()` to guarantee that the wrapped `_refreshSize()`
functions are invoked.
  • Loading branch information
Trott committed Jan 30, 2017
commit 2b509e3265ee27745bf58b1ef39784ea294c6904
5 changes: 3 additions & 2 deletions test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -16,7 +16,8 @@ const wrap = (fn, ioStream, string) => {
if (!common.isSunOS || e.code !== 'EINVAL')
throw e;
}
};
});
return wrapped;
};

process.stderr._refreshSize = wrap(originalRefreshSizeStderr,
Expand Down