(
extraEnv: Record<string, string | undefined>,
token?: string
)
| 23 | } |
| 24 | |
| 25 | function createClientWithEnv( |
| 26 | extraEnv: Record<string, string | undefined>, |
| 27 | token?: string |
| 28 | ): CopilotClient { |
| 29 | const childEnv = { |
| 30 | ...env, |
| 31 | ...extraEnv, |
| 32 | }; |
| 33 | const extraClient = new CopilotClient({ |
| 34 | workingDirectory: workDir, |
| 35 | env: childEnv, |
| 36 | logLevel: "error", |
| 37 | connection: RuntimeConnection.forStdio({ path: process.env.COPILOT_CLI_PATH }), |
| 38 | gitHubToken: token, |
| 39 | }); |
| 40 | onTestFinished(async () => { |
| 41 | try { |
| 42 | await extraClient.forceStop(); |
| 43 | } catch { |
| 44 | // Ignore cleanup errors |
| 45 | } |
| 46 | }); |
| 47 | return extraClient; |
| 48 | } |
| 49 | |
| 50 | async function configureAuthenticatedUser( |
| 51 | token: string, |
no test coverage detected
searching dependent graphs…