MCPcopy
hub / github.com/coder/mux / expectTranscriptContains

Method expectTranscriptContains

tests/ui/harness/chatHarness.ts:82–97  ·  view source on GitHub ↗
(
    needle: string | RegExp,
    timeoutMs: number = 30_000
  )

Source from the content-addressed store, hash-verified

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).

Calls 1

waitForFunction · 0.50

Tested by 1

setupNotificationTestFunction · 0.64