(
needle: string | RegExp,
timeoutMs: number = 30_000
)
| 80 | } |
| 81 | |
| 82 | async expectTranscriptContains( |
| 83 | needle: string | RegExp, |
| 84 | timeoutMs: number = 30_000 |
| 85 | ): Promise<void> { |
| 86 | await waitFor( |
| 87 | () => { |
| 88 | const text = this.container.textContent ?? ""; |
| 89 | if (typeof needle === "string") { |
| 90 | expect(text).toContain(needle); |
| 91 | } else { |
| 92 | expect(text).toMatch(needle); |
| 93 | } |
| 94 | }, |
| 95 | { timeout: timeoutMs } |
| 96 | ); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Wait for the workspace to finish streaming (handleStreamEnd fully processed). |