Skip to content

Commit 97b3f58

Browse files
committed
test: improve test coverage of readline/promises
1 parent 8a09a1e commit 97b3f58

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+
code: 'ABORT_ERR'
923+
}
924+
);
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)