X Tutup
The Wayback Machine - https://web.archive.org/web/20220320092903/https://github.com/nodejs/node/commit/cbcf794562
Skip to content
Permalink
Browse files
readline: improve code coverage for readline promises
PR-URL: #41817
Refs: https://coverage.nodejs.org/coverage-7123a00b03a90862/lib/readline/promises.js.html#L42
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
  • Loading branch information
ErickWendel authored and ruyadorno committed Feb 8, 2022
1 parent 451f333 commit cbcf7945628fd7f77f3af3b1cdf43632ebf562a5
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/parallel/test-readline-promises-interface.js
@@ -797,6 +797,24 @@ for (let i = 0; i < 12; i++) {
fi.emit('data', 'asdf\n');
}

// Ensure that options.signal.removeEventListener was called
{
const ac = new AbortController();
const signal = ac.signal;
const [rli] = getInterface({ terminal });
signal.removeEventListener = common.mustCall(
(event, onAbortFn) => {
assert.strictEqual(event, 'abort');
assert.strictEqual(onAbortFn.name, 'onAbort');
});

rli.question('hello?', { signal }).then(common.mustCall());

rli.write('bar\n');
ac.abort();
rli.close();
}

// Sending a blank line
{
const [rli, fi] = getInterface({ terminal });

0 comments on commit cbcf794

Please sign in to comment.
X Tutup