| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 05d652a commit ae12a60
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -910,6 +910,21 @@ for (let i = 0; i < 12; i++) { | |||
| 910 | 910 | rli.close(); | |
| 911 | 911 | } | |
| 912 | 912 | ||
| 913 | + // Throw an error when question is executed with an aborted signal | ||
| 914 | + { | ||
| 915 | + const ac = new AbortController(); | ||
| 916 | + const signal = ac.signal; | ||
| 917 | + ac.abort(); | ||
| 918 | + const [rli] = getInterface({ terminal }); | ||
| 919 | + assert.rejects( | ||
| 920 | + rli.question('hello?', { signal }), | ||
| 921 | + { | ||
| 922 | + name: 'AbortError' | ||
| 923 | + } | ||
| 924 | + ).then(common.mustCall()); | ||
| 925 | + rli.close(); | ||
| 926 | + } | ||
| 927 | + | ||
| 913 | 928 | // Can create a new readline Interface with a null output argument | |
| 914 | 929 | { | |
| 915 | 930 | const [rli, fi] = getInterface({ output: null, terminal }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments