-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathagent-test-runner.ts
More file actions
29 lines (25 loc) · 964 Bytes
/
agent-test-runner.ts
File metadata and controls
29 lines (25 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { ToolDef } from "./tool-matcher.js";
import {Assertion} from "chai";
export interface AgentTestRunner {
/**
* Simulates typing a string and waits for the turn to complete. It types one
* character at a time to avoid paste detection that the Gemini CLI has
*/
type(text: string): Promise<void>;
/**
* Looks for a specific string or regex to in the agent's output since the
* last time the user typed and pressed enter.
* Throws an error if the text is not found within the timeout.
*/
expectText(text: string | RegExp): Promise<void>;
/**
* Reads the agent's telemetry and looks for the given tool calls. Throws if
* an event is not found
*/
expectToolCalls(tools: ToolDef[]): Promise<void>;
/**
* Returns an assertion object for the path inside the run directory that can
* be asserted on via chai-fs's API: https://www.chaijs.com/plugins/chai-fs/
*/
expectFs(filePath: string): Chai.Assertion;
}