import { mkdtemp, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; import { fileURLToPath } from "node:url"; import { _electron as electron, expect } from "playwright/test"; const root = await mkdtemp(path.join(tmpdir(), "paseo-window-startup-")); const modulePath = fileURLToPath(new URL("../dist/window/show-when-ready.js", import.meta.url)); async function launchWindowWithoutHiddenFrames() { const main = path.join(root, "main.cjs"); await writeFile( main, `const { app, BrowserWindow } = require("electron"); const { showWindowWhenReady } = require(${JSON.stringify(modulePath)}); app.setPath("userData", ${JSON.stringify(path.join(root, "user-data"))}); app.whenReady().then(async () => { const win = global.mainWindow = new BrowserWindow({ show: false, paintWhenInitiallyHidden: false }); showWindowWhenReady(win, { showOnLoad: true }); await win.loadURL("data:text/html,