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

Function waitForAssertion

apps/kimi-code/test/cli/main.test.ts:155–167  ·  view source on GitHub ↗
(assertion: () => void)

Source from the content-addressed store, hash-verified

153}
154
155async function waitForAssertion(assertion: () => void): Promise<void> {
156 let lastError: unknown;
157 for (let attempt = 0; attempt < 20; attempt += 1) {
158 try {
159 assertion();
160 return;
161 } catch (error) {
162 lastError = error;
163 await new Promise((resolve) => setTimeout(resolve, 0));
164 }
165 }
166 throw lastError;
167}
168
169async function runHandleMainCommand(opts: CLIOptions): Promise<number | null> {
170 const exitSpy = vi.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => {

Callers 1

main.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected