diff --git a/packages/obsidian-testing-framework/src/util.ts b/packages/obsidian-testing-framework/src/util.ts index cd7cd3a..d3e5371 100644 --- a/packages/obsidian-testing-framework/src/util.ts +++ b/packages/obsidian-testing-framework/src/util.ts @@ -85,13 +85,13 @@ export async function doWithApp( export function waitForIndexingComplete(appHandle: JSHandle) { return appHandle.evaluate(() => { - return new Promise(res2 => { - // let resolved = false; + return new Promise((res2, rej2) => { + let resolved = false; app.metadataCache.on("resolved", () => { res2(null); - // resolved = true; + resolved = true; }); - // setTimeout(() => !resolved && rej2("timeout"), 10000); + setTimeout(() => !resolved && rej2("timeout"), 10000); }); }); }