| 65 | } |
| 66 | |
| 67 | class StubEventuallyFailingPrompt { |
| 68 | timeout?: NodeJS.Timeout; |
| 69 | |
| 70 | run() { |
| 71 | return new Promise((_, reject) => { |
| 72 | this.timeout = setTimeout(() => { |
| 73 | reject(new Error('This test prompt always reject')); |
| 74 | }, 1000); |
| 75 | }); |
| 76 | } |
| 77 | |
| 78 | close() { |
| 79 | clearTimeout(this.timeout); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | function createTestPromptModule(options: StreamOptions = {}) { |
| 84 | const module = inquirer.createPromptModule<TestQuestions>({ |
nothing calls this directly
no outgoing calls
no test coverage detected