()
| 9 | // Prompting in CI would hang forever / until a timeout occurs. |
| 10 | // We use prompts.inject() for testing prompts in our tests. |
| 11 | export const canPrompt = (): boolean => { |
| 12 | const injectedCount = (prompt as any)._injected?.length |
| 13 | if (injectedCount) { |
| 14 | // This is debug logging you can enable, but it will cause the affected test cases to fail output validation. |
| 15 | // process.stdout.write(`WARNING: Prompting is enabled, because the test injected ${injectedCount} prompt item(s)\n`) |
| 16 | return true |
| 17 | } |
| 18 | |
| 19 | return isInteractive() && !isCi() |
| 20 | } |
no test coverage detected