node/test/pseudo-tty/test-tty-stdout-resize.js
Antoine du Hamel ec26b1c01a
tools: add lint rule to ensure assertions are reached
PR-URL: https://github.com/nodejs/node/pull/60125
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-10-07 12:40:05 +00:00

12 lines
498 B
JavaScript

'use strict';
const { mustCall } = require('../common');
const assert = require('assert');
// tty.WriteStream#_refreshSize() only emits the 'resize' event when the
// window dimensions change. We cannot influence that from the script
// but we can set the old values to something exceedingly unlikely.
process.stdout.columns = 9001;
process.stdout.on('resize', mustCall());
process.kill(process.pid, 'SIGWINCH');
setImmediate(mustCall(() => assert.notStrictEqual(process.stdout.columns, 9001)));