Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: improve coverage for question in readline
  • Loading branch information
Ayase-252 committed May 24, 2021
commit daf78db1da304e8b4ccf879feda95669c7f34881
12 changes: 12 additions & 0 deletions test/parallel/test-readline-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,18 @@ for (let i = 0; i < 12; i++) {
rli.close();
}

// Calling the question multiple times
{
const [rli] = getInterface({ terminal });
rli.question('foo?', common.mustCall((answer) => {
assert.strictEqual(answer, 'baz');
}));
rli.question('bar?', common.mustNotCall(() => {
}));
rli.write('baz\n');
rli.close();
}

// Calling the promisified question
{
const [rli] = getInterface({ terminal });
Expand Down