The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { assert } from "@effect/vitest"; |
| 2 | import type { ProviderReplayTranscript } from "@t3tools/contracts"; |
| 3 | |
| 4 | import type { OrchestratorV2ScenarioResult } from "../../OrchestratorScenario.ts"; |
| 5 | import { |
| 6 | assertAssistantTextIncludes, |
| 7 | assertBaseProjection, |
| 8 | assertSemanticProjectionIntegrity, |
| 9 | assertUserMessagesInclude, |
| 10 | assertVisibleTurnItemsMirrorLocalTurnItems, |
| 11 | OPENCODE2_COMMAND_PROMPT, |
| 12 | projectionFor, |
| 13 | } from "../shared.ts"; |
| 14 | |
| 15 | export function assertOpenCode2CommandOutput( |
| 16 | result: OrchestratorV2ScenarioResult, |
| 17 | transcript: ProviderReplayTranscript, |
| 18 | ) { |
| 19 | assertBaseProjection({ result, transcript, runCount: 1, runStatuses: ["completed"] }); |
| 20 | const projection = projectionFor(result, transcript.scenario); |
| 21 | assertSemanticProjectionIntegrity(projection); |
| 22 | assertVisibleTurnItemsMirrorLocalTurnItems(projection); |
| 23 | assertUserMessagesInclude(projection, [OPENCODE2_COMMAND_PROMPT]); |
| 24 | assertAssistantTextIncludes(projection, "HELLO WORLD"); |
| 25 | assert.deepEqual( |
| 26 | projection.providerTurns.map((turn) => turn.status), |
| 27 | ["completed"], |
| 28 | ); |
| 29 | } |