From 2b2ac8449face5e1b749120ef177f3b317cc746f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Wed, 23 Oct 2024 03:08:13 -0400 Subject: [PATCH] re-add resolve timeout --- packages/obsidian-testing-framework/src/util.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); }); }); }