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 committed Nov 23, 2021
1 parent 516e29d commit bb3ff81
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-readline-promises-interface.js
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 bb3ff81

Please sign in to comment.