coffee
coffee copied to clipboard
Respond to multiple answers from command line
my command line tool asks me 2 questions. both needs to be answered with yes or no. here is my test code:
const Coffee = coffee.Coffee;
const response = await new Coffee({
method: 'fork',
cmd: path.join(__dirname, '../cli.js'),
opt: {
cwd: temp,
stdout: process.stdout,
stderr: process.stderr,
stdin: process.stdin
}
})
.debug(0)
.waitForPrompt()
.writeKey('n', 'ENTER')
.writeKey('n', 'ENTER')
.expect('code', 0)
.end();
the first question is correctly answered. But the second questions not. The Command line tool is now hanging on that second question.