Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5c99fc3

Browse filesBrowse files
gergelykeMylesBorins
authored andcommitted
test: backward compatible api for tty
PR-URL: #15235 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
1 parent 06ee10e commit 5c99fc3
Copy full SHA for 5c99fc3

File tree

Expand file treeCollapse file tree

1 file changed

+25
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+25
-0
lines changed
Open diff view settings
Collapse file
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict';
2+
const common = require('../common');
3+
4+
const noop = () => {};
5+
const TTY = process.binding('tty_wrap').TTY = function() {};
6+
7+
TTY.prototype = {
8+
setBlocking: noop,
9+
getWindowSize: noop
10+
};
11+
12+
const { WriteStream } = require('tty');
13+
14+
const methods = [
15+
'cursorTo',
16+
'moveCursor',
17+
'clearLine',
18+
'clearScreenDown'
19+
];
20+
21+
methods.forEach((method) => {
22+
require('readline')[method] = common.mustCall();
23+
const writeStream = new WriteStream(1);
24+
writeStream[method](1, 2);
25+
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.