MCPcopy
hub / github.com/di-sukharev/opencommit / waitForExit

Function waitForExit

test/e2e/utils.ts:247–262  ·  view source on GitHub ↗
(
  instance: RenderResult,
  timeoutMs: number = 20_000
)

Source from the content-addressed store, hash-verified

245 new Promise((resolve) => setTimeout(resolve, ms));
246
247export const waitForExit = async (
248 instance: RenderResult,
249 timeoutMs: number = 20_000
250): Promise<number> => {
251 const startedAt = Date.now();
252
253 while (Date.now() - startedAt < timeoutMs) {
254 const exit = instance.hasExit();
255 if (exit) {
256 return exit.exitCode;
257 }
258 await wait(25);
259 }
260
261 throw new Error('Process did not exit within the expected timeout');
262};
263
264export const getHeadCommitSubject = async (gitDir: string): Promise<string> => {
265 const { stdout } = await runGit(['log', '-1', '--pretty=%s'], gitDir);

Callers 7

smoke.test.tsFile · 0.90
gitPush.test.tsFile · 0.90
noChanges.test.tsFile · 0.90
oneFile.test.tsFile · 0.90
commitlint.test.tsFile · 0.90

Calls 1

waitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…