MCPcopy Create free account
hub / github.com/Noumena-Network/code / waitFor

Function waitFor

src/components/diff/DiffDetailView.test.tsx:107–118  ·  view source on GitHub ↗
(
  predicate: () => boolean,
  message: string,
  timeoutMs = 1500,
)

Source from the content-addressed store, hash-verified

105}
106
107async function waitFor(
108 predicate: () => boolean,
109 message: string,
110 timeoutMs = 1500,
111): Promise<void> {
112 const deadline = Date.now() + timeoutMs
113 while (Date.now() < deadline) {
114 if (predicate()) return
115 await Bun.sleep(10)
116 }
117 throw new Error(message)
118}
119
120async function renderDiffDetail(props: React.ComponentProps<typeof DiffDetailView>) {
121 const terminal = createFakeTerminal()

Callers 1

renderDiffDetailFunction · 0.70

Calls 1

sleepMethod · 0.80

Tested by

no test coverage detected