Skip to content

Commit

Permalink
test: improve coverage for question in readline
Browse files Browse the repository at this point in the history
PR-URL: #38799
Refs: https://coverage.nodejs.org/coverage-dc43066ee9a37655/lib/readline.js.html#L443
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Ayase-252 authored and danielleadams committed May 31, 2021
1 parent 4e58ec4 commit 1f5baaa
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit 1f5baaa

Please sign in to comment.