Skip to content

Commit 1f5baaa

Browse files
Ayase-252danielleadams
authored andcommitted
test: improve coverage for question in readline
PR-URL: #38799 Refs: https://coverage.nodejs.org/coverage-dc43066ee9a37655/lib/readline.js.html#L443 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Zijian Liu <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4e58ec4 commit 1f5baaa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/parallel/test-readline-interface.js

+12
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,18 @@ for (let i = 0; i < 12; i++) {
905905
rli.close();
906906
}
907907

908+
// Calling the question multiple times
909+
{
910+
const [rli] = getInterface({ terminal });
911+
rli.question('foo?', common.mustCall((answer) => {
912+
assert.strictEqual(answer, 'baz');
913+
}));
914+
rli.question('bar?', common.mustNotCall(() => {
915+
}));
916+
rli.write('baz\n');
917+
rli.close();
918+
}
919+
908920
// Calling the promisified question
909921
{
910922
const [rli] = getInterface({ terminal });

0 commit comments

Comments
 (0)