MCPcopy
hub / github.com/prisma/prisma / canPrompt

Function canPrompt

packages/internals/src/utils/canPrompt.ts:11–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9// Prompting in CI would hang forever / until a timeout occurs.
10// We use prompts.inject() for testing prompts in our tests.
11export 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}

Callers 5

handlePanicFunction · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90

Calls 2

isInteractiveFunction · 0.90
isCiFunction · 0.90

Tested by

no test coverage detected