mirror of
https://github.com/nodejs/node.git
synced 2026-12-06 11:48:45 -05:00
test: improve coverage for question in readline
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
2a1dea8a22
commit
ccde7fc2a6
1 file changed
+12
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user