mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
test: improve test coverage of readline/promises
PR-URL: https://github.com/nodejs/node/pull/40876 Refs: https://coverage.nodejs.org/coverage-0c2011c6c5d311a9/lib/readline/promises.js.html#L33 Reviewed-By: Qingyu Deng <i@ayase-lab.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
05d652a555
commit
ae12a609a5
1 file changed
+15
@@ -910,6 +910,21 @@ for (let i = 0; i < 12; i++) {
|
||||
rli.close();
|
||||
}
|
||||
|
||||
// Throw an error when question is executed with an aborted signal
|
||||
{
|
||||
const ac = new AbortController();
|
||||
const signal = ac.signal;
|
||||
ac.abort();
|
||||
const [rli] = getInterface({ terminal });
|
||||
assert.rejects(
|
||||
rli.question('hello?', { signal }),
|
||||
{
|
||||
name: 'AbortError'
|
||||
}
|
||||
).then(common.mustCall());
|
||||
rli.close();
|
||||
}
|
||||
|
||||
// Can create a new readline Interface with a null output argument
|
||||
{
|
||||
const [rli, fi] = getInterface({ output: null, terminal });
|
||||
|
||||
Reference in new issue
Block a user