Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve test coverage of readline/promises #40876

Merged
merged 2 commits into from
Nov 23, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
}
kuriyosh marked this conversation as resolved.
Show resolved Hide resolved
);
kuriyosh marked this conversation as resolved.
Show resolved Hide resolved
rli.close();
}

// Can create a new readline Interface with a null output argument
{
const [rli, fi] = getInterface({ output: null, terminal });
Expand Down