|
5 | 5 | import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' |
6 | 6 | import type { OrchestratorOptions } from './types' |
7 | 7 |
|
8 | | -const { |
9 | | - prepareExecutionContext, |
10 | | - getEffectiveDecryptedEnv, |
11 | | - runStreamLoop, |
12 | | - updateRunStatus, |
13 | | -} = vi.hoisted(() => ({ |
14 | | - prepareExecutionContext: vi.fn(), |
15 | | - getEffectiveDecryptedEnv: vi.fn(), |
16 | | - runStreamLoop: vi.fn(), |
17 | | - updateRunStatus: vi.fn(), |
18 | | -})) |
| 8 | +const { prepareExecutionContext, getEffectiveDecryptedEnv, runStreamLoop, updateRunStatus } = |
| 9 | + vi.hoisted(() => ({ |
| 10 | + prepareExecutionContext: vi.fn(), |
| 11 | + getEffectiveDecryptedEnv: vi.fn(), |
| 12 | + runStreamLoop: vi.fn(), |
| 13 | + updateRunStatus: vi.fn(), |
| 14 | + })) |
19 | 15 |
|
20 | 16 | vi.mock('@/lib/copilot/orchestrator/tool-executor', () => ({ |
21 | 17 | prepareExecutionContext, |
@@ -118,14 +114,13 @@ describe('orchestrateCopilotStream async continuation', () => { |
118 | 114 | }), |
119 | 115 | }) |
120 | 116 |
|
121 | | - runStreamLoop |
122 | | - .mockImplementationOnce(async (_url: string, _opts: RequestInit, context: any) => { |
123 | | - context.awaitingAsyncContinuation = { |
124 | | - checkpointId: 'checkpoint-1', |
125 | | - runId: 'run-1', |
126 | | - pendingToolCallIds: ['tool-1'], |
127 | | - } |
128 | | - }) |
| 117 | + runStreamLoop.mockImplementationOnce(async (_url: string, _opts: RequestInit, context: any) => { |
| 118 | + context.awaitingAsyncContinuation = { |
| 119 | + checkpointId: 'checkpoint-1', |
| 120 | + runId: 'run-1', |
| 121 | + pendingToolCallIds: ['tool-1'], |
| 122 | + } |
| 123 | + }) |
129 | 124 |
|
130 | 125 | const result = await orchestrateCopilotStream( |
131 | 126 | { message: 'hello' }, |
|
0 commit comments