()
| 101 | |
| 102 | const p = new Promise((resolve, reject) => { |
| 103 | const fn = (): void => { |
| 104 | // Use the signal to stop the ongoing request. |
| 105 | controller.abort(); |
| 106 | if (resError) { |
| 107 | return reject(resError); |
| 108 | } |
| 109 | resolve(generateReport()); |
| 110 | }; |
| 111 | if (options.duration) { |
| 112 | setTimeout(fn, options.duration * 1000); |
| 113 | } else { |
no test coverage detected