Skip to content

Commit ae12a60

Browse files
kuriyoshtargos
authored andcommitted
test: improve test coverage of readline/promises
PR-URL: #40876 Refs: https://coverage.nodejs.org/coverage-0c2011c6c5d311a9/lib/readline/promises.js.html#L33 Reviewed-By: Qingyu Deng <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 05d652a commit ae12a60

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/parallel/test-readline-promises-interface.js

+15
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,21 @@ for (let i = 0; i < 12; i++) {
910910
rli.close();
911911
}
912912

913+
// Throw an error when question is executed with an aborted signal
914+
{
915+
const ac = new AbortController();
916+
const signal = ac.signal;
917+
ac.abort();
918+
const [rli] = getInterface({ terminal });
919+
assert.rejects(
920+
rli.question('hello?', { signal }),
921+
{
922+
name: 'AbortError'
923+
}
924+
).then(common.mustCall());
925+
rli.close();
926+
}
927+
913928
// Can create a new readline Interface with a null output argument
914929
{
915930
const [rli, fi] = getInterface({ output: null, terminal });

0 commit comments

Comments
 (0)