This commit is contained in:
parent
2b2ac8449f
commit
810f08949a
@ -35,7 +35,6 @@ const obsidianTestFixtures: Fixtures<ObsidianTestFixtures> = {
|
||||
let mainFile = path.join(tmp.tmpdir, "obsidian");
|
||||
let electronFile = path.join(tmp.tmpdir, "electron");
|
||||
const packageJsonFile = path.join(tmp.tmpdir, "obsidian", "package.json");
|
||||
console.log("hello", getExe(), vault, mainFile);
|
||||
try {
|
||||
rmSync(mainFile, { recursive: true });
|
||||
rmSync(electronFile, { recursive: true });
|
||||
|
@ -75,9 +75,7 @@ export async function doWithApp<T = unknown>(
|
||||
callback: (a: App) => T | Promise<T>
|
||||
): Promise<T> {
|
||||
const cbStr = callback.toString();
|
||||
await page.exposeFunction("__callback", callback)
|
||||
return await page.evaluate<T, string>(async (cb) => {
|
||||
console.log("bye", Object.keys(app));
|
||||
const func = new Function(`return (${cb})(window.app)`)
|
||||
return await func();
|
||||
}, cbStr);
|
||||
|
Loading…
Reference in New Issue
Block a user