MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / waitForAssertion

Function waitForAssertion

apps/kimi-code/test/cli/run-prompt.test.ts:173–185  ·  view source on GitHub ↗
(assertion: () => void)

Source from the content-addressed store, hash-verified

171}
172
173async function waitForAssertion(assertion: () => void): Promise<void> {
174 let lastError: unknown;
175 for (let attempt = 0; attempt < 20; attempt += 1) {
176 try {
177 assertion();
178 return;
179 } catch (error) {
180 lastError = error;
181 await new Promise((resolve) => setTimeout(resolve, 0));
182 }
183 }
184 throw lastError;
185}
186
187describe('runPrompt', () => {
188 afterEach(() => {

Callers 1

run-prompt.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected