From 50ee4e6dad06a6f02c3aeaa1d1d3fef01b09c20a Mon Sep 17 00:00:00 2001 From: Rich Trott <rtrott@gmail.com> Date: Sun, 29 Jan 2017 18:18:20 -0800 Subject: [PATCH] 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> --- test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js b/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js index f1a95559b9dc92..f828e92afbe71c 100644 --- a/test/pseudo-tty/test-stderr-stdout-handle-sigwinch.js +++ b/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,