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

Function waitForDraftCount

tests/ui/workspaces/draft.test.ts:30–41  ·  view source on GitHub ↗

Wait for a specific number of drafts to exist

(projectPath: string, count: number)

Source from the content-addressed store, hash-verified

28
29/** Wait for a specific number of drafts to exist */
30async function waitForDraftCount(projectPath: string, count: number): Promise<string[]> {
31 return await waitFor(
32 () => {
33 const ids = getWorkspaceDraftIds(projectPath);
34 if (ids.length !== count) {
35 throw new Error(`Expected ${count} drafts, got ${ids.length}`);
36 }
37 return ids;
38 },
39 { timeout: 5_000 }
40 );
41}
42
43describeIntegration("Draft workspace behavior", () => {
44 beforeAll(async () => {

Callers 1

draft.test.tsFile · 0.85

Calls 2

getWorkspaceDraftIdsFunction · 0.90
waitForFunction · 0.50

Tested by

no test coverage detected