Skip to content

Commit

Permalink
test: improve test coverage of readline/promises
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
kuriyosh authored and targos committed Nov 26, 2021
1 parent 05d652a commit ae12a60
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-readline-promises-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit ae12a60

Please sign in to comment.