summaryrefslogtreecommitdiff
path: root/test/parallel/test-tty-backwards-api.js
blob: 547184728ebaf8c9f8190953175fb3ec5ce11cee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict';
const common = require('../common');

const noop = () => {};
const TTY = process.binding('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);
});