coffee icon indicating copy to clipboard operation
coffee copied to clipboard

Respond to multiple answers from command line

Open Darth-Alex opened this issue 5 years ago • 0 comments

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.

Darth-Alex avatar Nov 18 '20 15:11 Darth-Alex