diff options
author | Yoshiki Kurihara <yosyos0306@gmail.com> | 2021-11-23 09:11:30 +0900 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2021-11-26 15:36:34 +0100 |
commit | ae12a609a596596abc4d94ead253fb57aeb4dffc (patch) | |
tree | bdaed90f1b206b553f0272d6e5d13832498d2448 | |
parent | 05d652a555f5a6f7c16b0498591fed27e5f06136 (diff) | |
download | node-new-ae12a609a596596abc4d94ead253fb57aeb4dffc.tar.gz |
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>
-rw-r--r-- | test/parallel/test-readline-promises-interface.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/parallel/test-readline-promises-interface.js b/test/parallel/test-readline-promises-interface.js index 79803f99c1..e137886fa1 100644 --- a/test/parallel/test-readline-promises-interface.js +++ b/test/parallel/test-readline-promises-interface.js @@ -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 }); |