mirror of
https://github.com/nodejs/node.git
synced 2025-05-19 20:06:58 +00:00

PR-URL: https://github.com/nodejs/node/pull/22477 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
28 lines
577 B
JavaScript
28 lines
577 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
const common = require('../common');
|
|
|
|
const noop = () => {};
|
|
const { internalBinding } = require('internal/test/binding');
|
|
const TTY = internalBinding('tty_wrap').TTY = function() {};
|
|
|
|
TTY.prototype = {
|
|
setBlocking: noop,
|
|
getWindowSize: noop
|
|
};
|
|
|
|
const { WriteStream } = require('tty');
|
|
|
|
const methods = [
|
|
'cursorTo',
|
|
'moveCursor',
|
|
'clearLine',
|
|
'clearScreenDown'
|
|
];
|
|
|
|
methods.forEach((method) => {
|
|
require('readline')[method] = common.mustCall();
|
|
const writeStream = new WriteStream(1);
|
|
writeStream[method](1, 2);
|
|
});
|