-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert tty behavior for inquirer 7.x #903
Conversation
4b8e3f6
to
9cfb4cb
Compare
Codecov Report
@@ Coverage Diff @@
## master #903 +/- ##
==========================================
- Coverage 93.53% 93.27% -0.27%
==========================================
Files 26 26
Lines 1068 1071 +3
Branches 23 23
==========================================
Hits 999 999
- Misses 69 72 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love if you could port the test that uses a valid manually-opened tty from #898 into this - ensuring there's no regressions even if folks were to use skipTTYChecks: false
:
it('No exception when using tty other than process.stdin', function() {
// Manually opens a new tty
var input = new tty.ReadStream(fs.openSync('/dev/tty', 'r+'));
// Uses manually opened tty as input instead of process.stdin
var prompt = inquirer.createPromptModule({
input: input,
skipTTYChecks: false
});
var prompts = [
{
type: 'input',
name: 'q1',
default: 'foo',
message: 'message'
}
];
var promise = prompt(prompts);
promise.ui.rl.emit('line');
// Release the input tty socket
input.unref();
return promise.then(answers => {
expect(answers).to.deep.equal({ q1: 'foo' });
});
});
it will also help with getting a higher coverage
Thanks to both of you for the help on this issue :D |
|
* Move tty checks back to setupReadlineOptions * Implement skipTTYChecks and keep it enabled by default for inquirer 7.x. * test: add manual open tty check Co-authored-by: Ruy Adorno <ruyadorno@hotmail.com>
Fixes #902.