| 97 | } |
| 98 | |
| 99 | function createTestPrompter(): Prompter { |
| 100 | return { |
| 101 | selectOne: async <T>(opts: { options: Array<{ value: T }> }) => { |
| 102 | const preferredOption = opts.options.find((option) => option.value != null); |
| 103 | return (preferredOption ?? opts.options[0]).value; |
| 104 | }, |
| 105 | selectMany: async <T>(opts: { options: Array<{ value: T }> }) => |
| 106 | opts.options.map((option) => option.value), |
| 107 | confirm: async (opts: { defaultValue: boolean }) => opts.defaultValue, |
| 108 | }; |
| 109 | } |
| 110 | |
| 111 | function createPlatformPrompter(platforms: string[]): Prompter { |
| 112 | let selectManyCalls = 0; |