Skip to content

Commit

Permalink
test: improve test coverage of readline/promises
Browse files Browse the repository at this point in the history
  • Loading branch information
kuriyosh committed Nov 19, 2021
1 parent 8a09a1e commit 69f4058
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 }),
{
code: "ABORT_ERR"
}
);
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 69f4058

Please sign in to comment.