0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/pseudo-tty/test-tty-stdout-resize.js

12 lines
503 B
JavaScript
Raw Normal View History

'use strict';
const { mustCall } = require('../common');
const { notStrictEqual } = 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(() => notStrictEqual(process.stdout.columns, 9001)));